jeudi 27 septembre 2018

Random number out of three number in js

Hi I wanna get random numbers out of 2,3,5 . So i use this code.

function Random(low, hi) {
     return Math.floor(Math.random() * (hi - low + 1) + low);
 }

But this is only for 2 numbers , But i wanna get for 1 time for example 3 for 2 time 5, and 3 time 3 , but of course not exactly in that order . Any ideas ?




Aucun commentaire:

Enregistrer un commentaire