PageRenderTime 24ms CodeModel.GetById 19ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/test/loop.rb

http://github.com/feyeleanor/RubyGoLightly
Ruby | 18 lines | 10 code | 1 blank | 7 comment | 1 complexity | 2e0a49f411b55b19780fec84c1be0334 MD5 | raw file
 1x = 1
 2while x < 4
 3  puts x
 4  x = x + 1
 5end
 6# => 1
 7# => 2
 8# => 3
 9
10x = 4
11until x < 1
12  puts x
13  x = x - 1
14end
15# => 4
16# => 3
17# => 2
18# => 1