View difference between Paste ID: dbtjGT59 and q6wD7BwT
SHOW: | | - or go back to the newest paste.
1-
var userChoice = prompt("Do you choose rock,paper or scissor?");
1+
var r = Math.random();
2-
var computerChoice = Math.random();
2+
console.log(r);
3-
console.log(computerChoice);
3+
console.log((r < 0.34) ? "rock" : ((r < 0.67) ? "paper" : "scissors"));