4 ms·
Of COURSE you pass random in. Or the seed + current value of the PRNG. That's how companies like Blizzard do to reproduce any game state in games like Warcraf
by martinced 14y ago
Of COURSE you pass random in.
Or the seed + current value of the PRNG.
That's how companies like Blizzard do to reproduce any game state in games like Warcraft III. For example a replay file is tiny: the only thing that is saved are player inputs and the time at which they happened, as well as the seed to the PRNG.
You're likely confused because you think "random" means "true randomness" while typically we're using seeded PRNGs.
In addition to that, in language supporting high-order functions it's very common to pass a function to/from a function.
Passing in a PRNG function and the current value the PRNG is at is a very good way to get a 100% deterministic function inside a functional programming language.
Stop spreading FUD about FP.