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