Advertisement
achshar

Untitled

Apr 29th, 2013
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var userChoice = prompt("Do you choose rock,paper or scissor?");
  2. var computerChoice = Math.random();
  3. console.log(computerChoice);
  4. if(computerChoice < 0.34) console.log("rock");
  5. else if(computerChoice < 0.67) console.log("paper");
  6. else console.log("scissors");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement