A Swift implementation of the Squirrel3 hash function and pseudo-random number generator as invented by Squirrel Eiserloh, described in detail at the 2017 GDC Math for Game Programmers talk Noise-Based RNG.
Squirrel3
1.1.0
Swift language wrapper around the Squirrel3 hash/noise function from Squirrel Eiserloh
heckj/Squirrel3
What's New
Seedable protocol and consistent seed
2022-01-02T01:08:39Z
- Updates Squirrel3 with a new
SeededRandomNumberGenerator
protocol, which formalizes the ability to see a random number generator (specifically with a UInt64 seed), and references a constantseed
property and a variableposition
property for the generator. - updated Squirrel3 implementation to mutate on the position and keep the initial seed constant. With the two values together, the
next
generated random value is deterministic. - adds tests to verify the determinism as well as seed and position values.