SHOW:
|
|
- or go back to the newest paste.
| 1 | var userChoice = prompt("Do you choose rock,paper or scissor?");
| |
| 2 | var computerChoice = Math.random(); | |
| 3 | console.log(computerChoice); | |
| 4 | - | if(computerChoice >=0 && computerChoice <=0.33) {
|
| 4 | + | if(computerChoice < 0.34) console.log("rock");
|
| 5 | - | console.log("rock");
|
| 5 | + | else if(computerChoice < 0.67) console.log("paper");
|
| 6 | - | } |
| 6 | + | else console.log("scissors"); |