-
-
Save lijiang2087/5193981 to your computer and use it in GitHub Desktop.
A simple program - but why isn't it working?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var userChoice = prompt("Do you choose rock, paper or scissors?"); | |
var computerChoice = Math.random(); | |
console.log(computerChoice); | |
if (computerChoice <= 0.33); { | |
computerChoice = "rock"; | |
} else if (computerChoice <= 0.66); { | |
computerChoice = "paper"; | |
} else { | |
computerChoice = "scissors"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment