[Python-ideas] Python's Source of Randomness and the random.py module Redux

Chris Angelico rosuav at gmail.com
Fri Sep 11 12:30:40 CEST 2015

On Fri, Sep 11, 2015 at 8:26 PM, Nathaniel Smith <njs at pobox.com> wrote:
> A better strategy is, keep one global RNG for the level, but then when
> each new enemy is spawned, assign it its own RNG that will be used to
> determine its actions, and seed this RNG using a value sampled from
> the global RNG (!). Now the overall pattern of the game will be just
> as random, still be deterministic, and -- crucially -- it no longer
> matters what order we iterate over the enemies in.

As long as the order you seed their RNGs is deterministic. And if you
can do that, can't you iterate over them in a deterministic order too?


More information about the Python-ideas mailing list