What am i doing wrong ,is there anything missing i followed the instructions


i = 20
loop do
i -= 1
for i in 19..0
next if i % 2 == 0.5
print "#{i}"
break if i <= 0


First, where does the "loop" come from?

Edit: Nevermind, just looked it up, it seems to be a valid loop keyword.

On this line:

next if i % 2 == 0.5

You're telling the for loop to pass if there's a rest of 0.5, but it's a euclidian division, there will be no rest of 0.5 so nothing will get passed.

And as for your 19..0, I doubt it'll work, when I tried a decreasing for loop in the labs it didn't accept it.

You should try with downto (or do it manually with loop just like you're doing now).