Bug in excercise 8


#1

this is the error am getting each time i run this code`# test_1 = 77 != 77
test_1 = 88 != 88

test_2 = -4 <= -4

test_2 = -15 <= 12

test_3 = -44 < -33

test_3 = 23 < 45

test_4 = 100 == 1000

test_4 = 100 == 100`

Oops, try again. It looks like the boolean 'true' doesn't apear in your code.


#2

For this round, we'll show you the comparators and you set each variable to true or false

Where are your true and false?


#3

test 2 & 3 are true
while the rest are false


#4

as @arjofocolovi said, you have assign boolean true or false values to the test variables. Not give conditions which evaluates to true/false.


#5

Thanks all
I got it figured out


#6

Good luck on further lessons, and as always, ask if you're in need of help :smile:


#7

I realize this is kind of a late reply, but can you please clarify how we're supposed to assign true and false variables? Or just clarify which exercise taught us how to do that?


#8

im also having problems in this exersize


#9

dont know if its right, but worked
test_1 = 77 != 77
if true
print "true"
elsif
print "false"
end

test_2 = -4 <= -4
if true
print "true"
elsif
print "false"
end
test_3 = -44 < -33
if true
print "true"
elsif
print "false"
end

test_4 = 100 == 1000
if true
print "true"
elsif
print "false"
end


#10

I'm from Russia. I do not understand the logic of the English, in which the tasks are set at this point. Examples in the task actually is the answer. Why is not suitable as an answer? Please, do tasks more specific and detailed, people from other countries is very difficult to understand you!

Why it was necessary to write the next structure?
test_1 = 77 != 77
if true
print "true"
elsif
print "false"
end

test_2 = -4 <= -4
if true
print "true"
elsif
print "false"
end
test_3 = -44 < -33
if true
print "true"
elsif
print "false"
end

test_4 = 100 == 1000
if true
print "true"
elsif
print "false"
end

Why can not I use a comparator "=="?
Why it is necessary to use the "if - else - end"?


#11

test_1 = 77 != 77

test_1 = false

test_2 = -4 <= -4

test_2 = true

test_3 = -44 < -33

test_3 = true

test_4 = 100 == 1000

test_4 = false


#12

I worked on this lesson for 20 minutes because I did not understand what the heck the instructions on code academy was asking for. Kinda frustrating when I'm only at the beginning of the tutorial! Javapro56289 the last poster on this thread gave the answer which I am glad he did because it allowed me to go back and understand what the heck the instructions were asking for. I don't know how the instructions can get any clearer so it prevents these kinds of things but I can definitely say it is frustrating when you get slowed down in progression when you cant connect with the instructions.


#13

I could be really late but this is how I solved it.

# test_1 = 77 != 77
test_1 = 77 != 77
if test_1 == true
    print "true"
else
    print "false"
end

# test_2 = -4 <= -4
test_2 = -4 <=-4
if test_2 == true
    print "\n" + "true"
else
    print "\n" + "false"
end
# test_3 = -44 < -33
test_3 = -44 < -33
if test_3 == true
    print "\n" + "true"
else
    print "\n" + "false"
end    
# test_4 = 100 == 1000
test_4 = 100 == 1000
if test_4 == true
    print "\n" + "true"
else
    print "\n" + "false"
end

Hope this helps.


#14

Instruction of this lesson asks just to compare to the boolean state: is the state 'true' ot it's 'false', that's all.

test_1 = 77 != 77

test_1 = false

test_2 = -4 <= -4

test_2 = true

test_3 = -44 < -33

test_3 = true

test_4 = 100 == 1000

test_4 = false


#15

Can someone Explain why test 1 = false?
The logic is checking whether or not 77 = 77, which it does and is therefore true.

Going back, I think I may have figured out my own answer...Is it because != would make a statement true if the numbers were NOT equal?