This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var choice = function() | |
| { | |
| var userChoice = prompt("Select rock, paper, scissors,rope"); | |
| if(userChoice!=="rock" && userChoice!=="paper" && userChoice!=="scissors" && userChoice!=="rope") | |
| { | |
| alert("You have entered wrong choice, enter rock, paper, scissors or rope"); | |
| choice(); | |
| } | |
| else{ | |
| var computerChoice = Math.random(); |
NewerOlder