vendredi 27 juillet 2018

Creating a function that generates pseudo random numbers

I need to create a function in JavaScript that generates a pseudo random number between a minimum and maximum value, I also need this function to receive an integer value as a parameter, and that the number generated by the function is always the same according to the value used .

function random(seed, min, max)

random(5, 0, 500) => 354
random(184, 0, 500) => 412
random(5, 0, 500) => 354

Is it possible to create a function that does as described and has a good variation of results?




Aucun commentaire:

Enregistrer un commentaire