Skip to content

Instantly share code, notes, and snippets.

@suwa320
Created May 15, 2012 18:52
Show Gist options
  • Select an option

  • Save suwa320/2704144 to your computer and use it in GitHub Desktop.

Select an option

Save suwa320/2704144 to your computer and use it in GitHub Desktop.
[*0..10].reverse.each{|i| puts i}
10.step(0, -1){|i| puts i}
(-10..0).each{|i| i *= -1; puts i}
r = (10..0)
(r.first).downto(r.last).each{|i| puts i}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment