My current code is
function RNG(){
var y = Math.random();
if(y < 0.5){
x = 1
}
if(y > 0.5){
x = 0
}
console.log(x)
}
RNG()
if(x = 1){
document.writeln('Yes')
}
else{
document.writeln('No')
}
to randomly generate text that says either yes or no, it always comes up with a different number, but always writes yes. (Using purejs)
Aucun commentaire:
Enregistrer un commentaire