Try 103.times; see what you get. The last number is not a sum.
···
----- Original Message -----
From: Bob X
Sent: Saturday, November 09, 2002 9:43 AM
To: ruby-talk@ruby-lang.org
Subject: Re: Lighting Rod
“Kirk Haines” khaines@enigo.com wrote in message
news:48674.148.78.249.10.1036859159.squirrel@enigo.com…
Eric Armstrong said:
And this is certainly inconsistent with what is stated in the Pickaxe
book:“Iterates block int times, passing in values from zero to int - 1”
Isn’t that exactly what it is doing?
irb(main):001:0> 3.times {|d| puts d}
0 <— value starting at zero
1
2 <— to int(3)-1 which would 2
3 <— this is the return value (0,1,2 = 3)
Maybe I am mistaking what you are saying.
BobGet more from the Web. FREE MSN Explorer download : http://explorer.msn.com