Skip to content

Instantly share code, notes, and snippets.

var userChoice = prompt("Please choose rock, paper, or scissors");
var computerChoice = Math.random();
if(computerChoice >=0 && computerChoice<0.33){
computerChoice = "rock"
}
elseif(computerChoice >0.33 && computerChoice<0.67){
computerChoice = "scissors"
}
else computerChoice = "paper"
compare(userChoice, computerChoice)