Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created January 11, 2017 00:55
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/49e910512a6a1cd6778a2422c2dc9589 to your computer and use it in GitHub Desktop.
Save codecademydev/49e910512a6a1cd6778a2422c2dc9589 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();
console.log(computerChoice);
if (computerChoice < 0.33) {
computerChoice = "rock";
} else if (computerChoice < 0.67) {
computerChoice = "paper";
} else {
computerChoice = "scissors";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment