So I am confused why we use Math.floor()
for creating random numbers versus Math.round()
or Math.ceil()
.
For example:
var enemyNumber = Math.floor(Math.random() * 4);
Why don't we use var enemyNumber = Math.ceil(Math.random() * 4);
or var enemyNumber = Math.ceil(Math.random() * 4);
Aucun commentaire:
Enregistrer un commentaire