Next! topic.Program doesnt work


#1



i = 20
loop do
  i -= 1
  next if i > 18
  puts "#{i}"
  break if i <= 0
end

It doesnt work,writing Oops, try again. It looks like your loop doesn't print out the numbers 18 to 0.

Console is
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
nil


#2

It seems to work a whole lot though.
Not passing is another matter, but that doesn't make it work any less. Let's just not use the word "work", it's really uninformative anyway.

I'd read the instructions really carefully, perhaps you missed some detail. For example it says print, maybe they mean the function print and not just the English word print


#3

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