Math.random(); Help


If I were to make a Math.random(); or Math.floor(Math.random()); and use console it would make a number like 6 or something. What if I want the number to only be chosen from 1-3 and it would choose 1 2 or 3 randomly. How would I make this code?

Sorry if I didn’t choose the right getting started category! I’m new to the whole forums thing.


see here:

The math is explained. If the random value can be zero, -min and +min can be excluded


Thanks for the help! : )


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.