Tip: You can modify some of the code before running
<ptml> <pead> <meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "> <title> scissors Stone cloth </title> </pead> <body> <script language=" JavaScript " ; function PlayGame (choice) {with (document.game) {comp = Math.Round ((Math.random () * 2) + 1); var choicename; if (comp = = 1) choicename = "Rock"; if (comp = = 2) Choicename = "paper"; if (comp = = 3) Choicename = "scissors"; Msg.value = ' The computer chose ' + Choicename + '; '; Switch (choice) {case 1:if (comp = = 1) {draw.value++; Msg.value + = ' It is a draw. '; if (comp = = 2) {loss.value++; Msg.value + = ' you lost! '; Break if (comp = = 3) {win.value++; msg.value = ' You won! '; Break Case 2:if (Comp = = 1) {win.value++; Msg.value + = ' you won! '; Break } if (comp = = 2) {draw.value++; msg.value = ' It is a draw. '; if (comp = = 3) {loss.value++; msg.value = ' You lost! '; Break }Case 3:if (Comp = = 1) {loss.value++; Msg.value + = ' you lost! '; Break if (comp = = 2) {win.value++; msg.value = ' You won! '; Break } if (comp = = 3) {draw.value++; msg.value = ' It is a draw. '; } Msg.value + = ' Go again! '; } </script> <center> <form name=game> <table border=1 cellpadding=5> <tr> <td align=ce nter>user:</td> <td align=center> </td> <td align=center> </td> <td align=center > </td> </tr> <tr> <td colspan=4 align=center><input type=text name=msg size=45></ td> </tr> <tr> <td colspan=4 align=center> <input type=text name=win readonly value= "0" size= "2" & Gt Wins <input type=text name=loss readonly value= ' 0 "size=" 2 "> Losses <input type=text name=draw readonly value=" 0 " Size= "2" > Draws </td> </tr> </table> </form> </center> </body> </ptml>
Tip: You can modify some of the code before running