I\'m working on making my first game (Rock Paper Sissors) and I ran into an issue where when the userChoice is scissors and the com
This is the code I made at this exercise and it worked like a charm... I used logical operators on my "if" statements, and it was accepted(obviously).
Give it a try :D
var userChoice = prompt("Do you choose rock, paper or scissor?");
var computerChoice = Math.random();
if (computerChoice > 0 && computerChoice < 0.33) {
computerChoice = "Rock";
} else if (computerChoice > 0.34 && computerChoice < 0.67) {
computerChoice = "Paper";
} else {
computerChoice = "Scissor";
}
console.log(computerChoice);