Created
January 2, 2014 18:19
-
-
Save brigand/8223758 to your computer and use it in GitHub Desktop.
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 <= 1/3){ | |
computerChoice = "rock"; | |
} else if(computerChoice <= 2/3){ | |
computerChoice = "paper"; | |
} else if(computerChoice <= 1){ | |
computerChoice = "scissors"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment