Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created December 8, 2016 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/ea674434800fa346bd5287ad157bf0a4 to your computer and use it in GitHub Desktop.
Save codecademydev/ea674434800fa346bd5287ad157bf0a4 to your computer and use it in GitHub Desktop.
Codecademy export
var userChoice= prompt("Do you choose rock, paper or scissors?");
var computerChoice= Math.random();
var userChoice = prompt( "Do you choose rock, paper or scissors?")
console.log("User Choice: " + userChoice);
var computerChoice= Math.random(); {
if (computerChoice<0.33) {
computerChoice= "rock";
}
else if (computerChoice>0.67) {
computerChoice= "paper";
}
else {
computerChoice= "scissors";
}
}
console.log(Computer Choice: + computerChoice);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment