Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var userChoice = prompt("Do you choose rock, paper or scissors?");
- var computerChoice = Math.random();
- if (computerChoice > 0 && computerChoice < 0.33)
- {
- computerChoice === "rock"
- }
- else if (computerChoice > 0.34 && computerChoice < 0.66)
- {
- computerChoice === "paper"
- }
- else if (computerChoice > .67 && computerChoice < 1)
- {
- computerChoice === "scissors"
- }
- console.log(computerChoice)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement