trekhleb / javascript-algorithms

📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings
MIT License
185.07k stars 29.85k forks source link

Added Linear congruential generator #1035

Open AlgorithmicNonsense opened 1 year ago

AlgorithmicNonsense commented 1 year ago

Adding a simple implementation of a linear congruential generator for generating n pseudorandom numbers.

AlgorithmicNonsense commented 1 year ago

Might as well use a js generator function to save the state instead of n numbers beginning with seed.