wren icon indicating copy to clipboard operation
wren copied to clipboard

Remove `randomSeed1()`'s reliance on cstdlib's rand implementation.

Open nitz opened this issue 1 year ago • 1 comments

This adds a simple TLCG to initialize the random state when only a number is supplied as seed.

This has the result of removing the reliance on cstdlib's srand()/rand() implementations for setting the initial state, meaning that the same seed value will have the same effect regardless of platform.

Proposed as a solution for #1098

nitz avatar Jul 20 '22 15:07 nitz

For consistencies sake wouldn't it make sense to do the same thing for randomSeed0()? Using time as the seed value?

ConfusedSky avatar Jul 31 '22 06:07 ConfusedSky