mardi 2 avril 2019

how to use if(math.random == 50)? [on hold]

So i am trying to make a site that picks a random number and if that number is between for example 50-60 it is going to do something

Here is some code:

var opengg;
window.onload = function() {
    opengg = function() {
    console.log(Math.floor(Math.random() * 100));
    if (Math.floor(Math.random() * 100) == 50) {
            console.log("test")
        }
    }
}

Aucun commentaire:

Enregistrer un commentaire