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