[gambit-list] Random random-integer?

Marc Feeley feeley at iro.umontreal.ca
Tue Sep 11 07:31:52 EDT 2007


On 11-Sep-07, at 6:53 AM, David St-Hilaire wrote:

> Hi!
>
> I'm using the random-integer function, but it would seem that it  
> always give the
> same set of results after each execution... I then guessed I had to  
> set the
> random seed, somehow but I couldn't figure out the way to do it...
>
> I tried something like:
>
> (set! default-random-source (make-random-source))
> (random-source-randomize! default-random-source)
> (pp (random-integer 10))
> (pp (random-integer 10))
> (pp (random-integer 10))

Remove the assignment to default-random-source and everything will  
work as expected.

Marc




More information about the Gambit-list mailing list