Random numbers tutorial

just to point somthin out kirupa… its actually
Math.random()*(high-low)+low;
because if you do
Math.random()*70 + 7;
it will give you between 7 and 77… because if the random number returns 70 it will add 7 to it… just to point that out if you wanna change it in your tutorial…:cool:

On the subject of random numbers in Flash: I just used the syntac random() in an MX project and it works just fine. However, I get repetitive number sequences a lot.

With your approach will I get a more diversified results set?

G

Nevermind - tried it out and it works much better ;).

Thanks

see http://www.kirupaforum.com/showthread.php?s=&threadid=11686#post81565

Lovely thread. I put it in the best of. And Scootman, thanks for spotting that :slight_smile:

no problem, in school im learning programming, c++ mostly, but random numbers we used a lot in the beginning and that just kinda jumped out at me, glad i could help

Thanks scootman for pointing the error out. I just fixed it.

Cheers!
Kirupa :eye: