Last active
June 12, 2017 16:17
-
-
Save thinsoldier/65e1cee967c60f2879409d613b537002 to your computer and use it in GitHub Desktop.
This file contains hidden or 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(); | |
if(computerChoice <= 0.33){ | |
computerChoice = "rock"; | |
} | |
else if(computerChoice >= 0.34 && computerChoice <= 0.66){ | |
computerChoice = "paper"; | |
} | |
else if(computerChoice >= 0.67){ | |
computerChoice = "scissors"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment