I am a new coder skimming the basics of JavaScript, and was trying to follow this tutorial but could not get this to work. Any help would be appreciated :)
var userChoice = prompt("Do you choose rock, paper or scissors?")
var computerChoice = Math.random();
console.log(computerChoice);
if (computerChoice > 0 && < 0.33) {
(computerChoice = "rock");
}
else if (computerChoice > 0.34 && < 0.66) {
(computerChoice = "paper");
}
else (computerChoice > 0.67 && < 1) {
(computerChoice = "scissors");
}
Aucun commentaire:
Enregistrer un commentaire