var userChoice = prompt("paper scissors rock"); var x = Math.floor(Math.random() * 3 + 1); console.log(x); if ((userChoice === "paper") && (x === 1)) {alert("draw");} else if ((userChoice === "paper") && (x === 2 )) {alert("scissors beats paper");} else if ((userChoice === "paper") && (x === 3 )) {alert("paper beats rock");} else if ((userChoice === "rock") && (x === 1 )) { alert("paper beats rock");} else if ((userChoice === "rock") && (x === 2 )) { alert("rock beats scissors");} else if ((userChoice === "rock") && (x === 3 )) { alert("draw");} else if ((userChoice === "scissors") && (x === 1 )) { alert("scissors beats paper");} else if ((userChoice === "scissors") && (x === 2 )) { alert("draw");} else if ((userChoice === "scissors") && (x === 3 )) { alert("rock beats scissors");} console.log(x);