What am I doing wrong? RoR


#1
# boolean_1 = 77 < 78 && 77 < 77
boolean_1 = 77 < 78 && 77 < 77
if boolean_1 = true
print "1.Good job "
else print "1.Not true " 
end
# boolean_2 = true && 100 >= 100
boolean_2 = true && 100 >= 100
if boolean_2 = true
print "2.Good job "
else print "2.Not true "
end
# boolean_3 = 2**3 == 8 && 3**2 == 9
boolean_3 = 2**3 == 8 && 3**2 == 9
if boolean_3 = true
print "3.Good job "
else print "3.Not true "
end


#2

the error msg says that smt wrong with 2nd, 8th and 14th string. but for me, it seems ok, and the final result is correct.


#3

boolean_1 is false, so it should print 1.Not true, which is not happening, because you made a mistake in the if condition


#4

Tnx 4 ur answer. I know, that smt isn’t right. But what? Give me a hint or the correct code, so I know how to make it, please.


#5

i think the error message in console is pretty good? = will assign a value, not check if values equals


#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.