feat(random)!: add random functions rand and getSeed. seedRand no longer returns function and accepts a number #396
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Random implementation based off Python random module
randInt
andseedRand
to own file, addedrand
andgetSeed
functionsseedRand
no longer returnsrand
as a function but instead just modifies the seedseedRand
accepts a number (or no parameter and defaults to current time)seedRand
string hash function from xfnv1a to MurmurHash3 to reuseMath.iml
for slightly better compressionrandInt
accepts a function as 3rd parameter which can be used to pass a function that can bias the random numberrandInt
usesrand
by default instead ofMath.random
so is affected by seeding the PRNGCloses #379
Closes #378
Closes #377
Closes #374