Advertisement
Guest User

Untitled

a guest
Jul 31st, 2015
198
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 scissors?");
  2. var computerChoice = Math.random();
  3.  
  4.  
  5. if (computerChoice > 0 && computerChoice < 0.33)
  6. {
  7.   computerChoice === "rock"
  8. }
  9. else if (computerChoice > 0.34 && computerChoice < 0.66)
  10. {
  11.     computerChoice === "paper"
  12. }
  13. else if (computerChoice > .67 && computerChoice < 1)
  14. {
  15.     computerChoice === "scissors"
  16. }
  17. console.log(computerChoice)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement