Skip to content

Instantly share code, notes, and snippets.

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