[Ironruby-core] rand() needs a seed?

Johan Danforth Johan.Danforth at irm.se
Sun Jul 6 10:28:19 EDT 2008


I'm a noob Ruby user, but IronRuby behaves different from other Ruby implementations that I've tried, in IronRuby (rev 121) this code:

100.times {p rand(100)}

Often returns the same value for (almost) all iterations, like this:

2
2
2
2
2
2
2
2
...and so on...

Works as designed? Need to seed it or something?

/Johan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20080706/4f69f160/attachment-0001.html>


More information about the Ironruby-core mailing list