Code: Select all
var myNumber = Math.floor((Math.random() * 20) + 1);
console.log('The number is %s', myNumber)Code: Select all
var myNumber = Math.floor((Math.random() * 200) + 50);
console.log('The number is %s', myNumber)Which... I don't understand anything of. I've never had a mind for math, so this whole thing just makes my head hurt. I just want to know how to do a basic random.org roll without having to link players to random-org...The Math.random() function returns a floating-point, pseudo-random number in the range 0 to less than 1 (inclusive of 0, but not 1) with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user.
I also wanted to figure out how to do a complex score system, like the ones in my lottery teases, but I gave up on that real quick. If I can't even get a random number, I'm clearly too dumb for this...







my teases