poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Seeds and pseudo-random numbers


From: Jose E. Marchesi
Subject: Seeds and pseudo-random numbers
Date: Sat, 18 Jul 2020 14:10:50 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Hi people.

I just pushed a patch that makes the `rand' built-in to get an optional
argument:

  defun rand = (uint<32> seed = 0) int<32>

If SEED is not 0, it is set as the seed for this and subsequent
pseudo-random numbers.  The indended use is a first call to rand passing
some seed, and subsequent calls to rand without an argument.

At the moment we don't have a way at the Poke level to get meaningful
seeds... I suppose we need to add a `time' function to get the current
Unix time, or something like that.

Salud!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]