OrganicFreeStyle
6/11/2006 4:30:00 PM
ZeD wrote:
> OrganicFreeStyle wrote:
>
> > Hi all. I'm programming a model of economic relationships in both
> > python and ruby near simultaneously, and as with most simulations, I
> > need to generate a random number within a specific range. I'm a python
> > man, and in python you can call random.randint(min, max) to achieve
> > this. Rand allows you to set the max, but what about the min? Is there
> > a similar method to Python's randint() in Ruby? Alternative random
> > number generators that have this ability? Thanks.
>
> from a non-ruby developer :)
>
> min + rand (max-min)
>
> --
> Under construction
Brilliant. Such elegance! Thank you ZeD, much appreciated.