123456789101112131415161718192021222324252627 |
- <head>
- <h1>Scissors</h1>
- </head>
- <body>
- <script>
- let userBid = +prompt("Enter bid 1-3 1=stone 2= scissors 3= paper");
- if (1 >= userBid >= 3) {
- alert(" Non correct bid");
- }
- else {
- let machimeBid = Math.floor(Math.random() * 3 + 1);
- alert(userBid + " " + machimeBid);
- if (userBid == machimeBid) {
- alert("Nobody win");
- }
- else {
- if ((userBid - machimeBid) > 1 ||
- ((machimeBid - userBid) <= 1 &&
- (machimeBid - userBid) >= 0))
- alert("Congrats, You WIN!");
- else
- alert("Sorry, You WoN");
- }
- }
- </script>
- </body>
|