For some reason this code isn't working and I really can't see what's wrong with it! I'm using modulus to see if a number is odd, then skip to the next iteration of the loop if it is. But I'm getting the following error message:
Oops, try again. It looks like your loop doesn't print out the numbers 18 to 0.
I know I need to add an exception for 1, because 1/3 won't equal 0. But it doesn't seem to be writing the correct numbers to the console. Here's what comes out:
Can anyone see what's wrong with this code? Thank you!
i = 20 loop do i -= 1 next if i % 3 == 0 break if i <= 0 print i end