On May 3, 10:24 pm, Linux Devil <devil.of.li... / gmail.com> wrote:
> Wyatt Greene wrote:
> > I love the flexibility of Ruby.  It gives you several ways to do
> > something, leaving you to pick the most appropriate one.  In the
> > spirit of showing off the flexibility of Ruby, I'd like to see how
> > many different ways there are to write a loop that prints the numbers
> > 1 to 100, one on each line.  I'll start off:
>
> >   1.upto(100) { |x| puts x }
>
> > I know there's at least a dozen more ways to do this...
>
> 100.times {|x| puts x + 1}
> (1..100).to_a.each {|x| puts x}
> --
> Posted viahttp://www.ruby-forum.com/.

p *1..100