Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var userChoice = prompt("Do you choose rock, paper or scissors?");
- var computerChoice = Math.random();
- console.log(computerChoice);
- if ((computerChoice > 0) and (computerChoice <0.33))
- {
- return (computerChoice === "rock");
- }
- else if ((computerChoice >= 0.34) and (computerchoice <=0.66))
- {
- return (computerChoice === "paper");
- }
- else
- {
- return (computerChoice === "scissors");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement