hw05_15_1.html 575 B

12345678910111213141516171819
  1. <head>
  2. <h1>Scissors</h1>
  3. </head>
  4. <body>
  5. <script>
  6. let userBid = +prompt("Enter bid 1-3 1=stone 2= scissors 3= paper");
  7. let machimeBid = Math.floor(Math.random() * 3 + 1);
  8. alert(userBid + " " + machimeBid);
  9. userBid == machimeBid ?
  10. alert("Nobody win") :
  11. ((userBid - machimeBid) > 1 ||
  12. ((machimeBid - userBid) <= 1 &&
  13. (machimeBid - userBid) >= 0)) ?
  14. alert("Congrats, You WIN!")
  15. :
  16. alert("Sorry, You WoN");
  17. </script>
  18. </body>