hello all, I just ran into something interesting. I was just playing around
trying different things out and ended  up coming across this. if I do
something like this:
num = rand(10)
5.times {puts num}
that will give me the same random number 5 times (ie. 2 2 2 2 2). but if I
do the same thing but don't store the random number in a variable:
5.times {puts rand(10)}
then it works as expected (2 6 1 1 9 4). does anyone know why that is? and
if I did want to store a random value in a variable, how would i then do so
without getting the same number every time I call it?
(supressed text/html)
Unsubscribe: <mailto:ruby-talk-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>