Skip to content

Instantly share code, notes, and snippets.

@lijiang2087
Created March 19, 2013 05:52
Show Gist options
  • Save lijiang2087/5193981 to your computer and use it in GitHub Desktop.
Save lijiang2087/5193981 to your computer and use it in GitHub Desktop.
A simple program - but why isn't it working?
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.66); {
computerChoice = "paper";
} else {
computerChoice = "scissors";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment