主题:[原创]猜拳小游戏
CLS
RANDOMIZE TIMER
FOR K = 1 TO 9
PRINT
NEXT
PRINT " Guess Fist"
PRINT " Press any key to play"
PRINT " Press Ctrl+Break to end"
DO
LOOP UNTIL INKEY$ <> ""
CLS
FOR I = 1 TO 3
READ A$(I)
NEXT
DATA >B,O-,*-
N = FIX(RND * 3 + 1)
PRINT " >B, Scissors, Jian Dao ; O- ,Hammer ,Cui Zi ; *- , Cloth , Bu ";
1 INPUT "", P$
IF P$ = ">B" THEN P = 1
IF P$ = "O-" THEN P = 2
IF P$ = "*-" THEN P = 3
IF P$ <> ">B" AND P$ <> "O-" AND P$ <> "*-" THEN PRINT "???": GOTO 1
PRINT "You:"; A$(P)
PRINT "Computer:"; A$(N)
IF N = 1 AND P = 1 THEN PRINT "Draw!!": GOTO 1
IF N = 1 AND P = 2 THEN PRINT "You Win!!": END
IF N = 1 AND P = 3 THEN PRINT "Computer Win!!": GOTO 1
'--------------
IF N = 2 AND P = 2 THEN PRINT "Draw!!": GOTO 1
IF N = 2 AND P = 3 THEN PRINT "You Win!!": END
IF N = 2 AND P = 1 THEN PRINT "Computer Win!!": GOTO 1
'--------------
IF N = 3 AND P = 3 THEN PRINT "Draw!!": GOTO 1
IF N = 3 AND P = 1 THEN PRINT "You Win!!": END
IF N = 3 AND P = 2 THEN PRINT "Computer Win!!": GOTO 1
'--------------
END
'有一些方法有点笨,大家不要嘲笑
RANDOMIZE TIMER
FOR K = 1 TO 9
NEXT
PRINT " Guess Fist"
PRINT " Press any key to play"
PRINT " Press Ctrl+Break to end"
DO
LOOP UNTIL INKEY$ <> ""
CLS
FOR I = 1 TO 3
READ A$(I)
NEXT
DATA >B,O-,*-
N = FIX(RND * 3 + 1)
PRINT " >B, Scissors, Jian Dao ; O- ,Hammer ,Cui Zi ; *- , Cloth , Bu ";
1 INPUT "", P$
IF P$ = ">B" THEN P = 1
IF P$ = "O-" THEN P = 2
IF P$ = "*-" THEN P = 3
IF P$ <> ">B" AND P$ <> "O-" AND P$ <> "*-" THEN PRINT "???": GOTO 1
PRINT "You:"; A$(P)
PRINT "Computer:"; A$(N)
IF N = 1 AND P = 1 THEN PRINT "Draw!!": GOTO 1
IF N = 1 AND P = 2 THEN PRINT "You Win!!": END
IF N = 1 AND P = 3 THEN PRINT "Computer Win!!": GOTO 1
'--------------
IF N = 2 AND P = 2 THEN PRINT "Draw!!": GOTO 1
IF N = 2 AND P = 3 THEN PRINT "You Win!!": END
IF N = 2 AND P = 1 THEN PRINT "Computer Win!!": GOTO 1
'--------------
IF N = 3 AND P = 3 THEN PRINT "Draw!!": GOTO 1
IF N = 3 AND P = 1 THEN PRINT "You Win!!": END
IF N = 3 AND P = 2 THEN PRINT "Computer Win!!": GOTO 1
'--------------
END
'有一些方法有点笨,大家不要嘲笑