Skip to content

Instantly share code, notes, and snippets.

@rusco
Created December 10, 2020 20:47
Show Gist options
  • Save rusco/702f06541f897100ecd8f40c08ce39a0 to your computer and use it in GitHub Desktop.
Save rusco/702f06541f897100ecd8f40c08ce39a0 to your computer and use it in GitHub Desktop.
random numbers in javascript with seed to be reproduceable
const seed = 1;
function random() {
const x = Math.sin(seed++) * 10000;
return x - Math.floor(x);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment