mardi 21 mai 2019

Get random boolean from number and seed in JS

How can I generate random boolean from seed and number (index)?

I tried some random generators, but they have state, which I don't want to have.

Examples:

let seed = 78787687757;
gen(seed, 0) // some bool
gen(seed, 1) // some bool
gen(seed, 2) // some bool
gen(seed, 5) // some bool
gen(seed, 565965) // too bool




Aucun commentaire:

Enregistrer un commentaire