主题:[讨论]剪刀石头布
超人归来
[专家分:0] 发布于 2007-08-06 17:27:00
发个程序
回复列表 (共10个回复)
沙发
yfyf [专家分:440] 发布于 2007-08-06 17:35:00
CLS
PRINT "jian dao,bao fu ,chui you xi shuo ming:"
PRINT "jian dao: 3,bao fu: 2,chui: 1"
REM "a=int(rnd*3+1) shi ran jian nao sui ji chan sheng 1 ge shu"
a = INT(RND * 3 + 1)
PRINT
PRINT "you xi kai shi,ni zhui bei hao le ma?"
PRINT
PRINT "dian nao yi jing zhun bei hao!"
100 INPUT "gai ni chu le(1 or 2 or 3):", b
IF b > 3 OR b < 1 THEN PRINT "ni zhen ben,chong xi shu ru:": GOTO 100
IF a = b THEN PRINT "ping ju,qing zai lai 1 ju ba!": END
IF a > b AND a - b = 1 THEN
PRINT "dian nao chu:"; a, "ni chu:"; b, "ni shu la,hai gan tiao zhan ma?": END
END IF
IF a > b AND a - b = 2 THEN
PRINT "dian nao chu:"; a, "ni chu:"; b, "ni yin la,ni zheng bang!": END
END IF
IF a < b AND a - b = -1 THEN
PRINT "dian nao chu:"; a, "ni chu:"; b, "ni yin la,ni zheng bang!": END
END IF
IF a < b AND a - b = -2 THEN
PRINT "dian nao chu:"; a, "ni chu:"; b, "ni shu la,hai gan tiao zhan ma?": END
END IF
板凳
yfyf [专家分:440] 发布于 2007-08-06 18:06:00
不错吧
3 楼
wzc1996 [专家分:1680] 发布于 2007-08-06 19:46:00
a
4 楼
wzc1996 [专家分:1680] 发布于 2007-08-06 19:46:00
5 楼
Matodied [专家分:7560] 发布于 2007-08-06 21:15:00
你这个太一般了……都是拼音,还有错别字……反正先看我的。
CLS
a$ = "Equal!": b$ = "Computer win!": c$ = "You win!"
d$ = "Player1 win!": e$ = "Player2 win!"
DATA 0,2,5
DIM a(3)
FOR i = 1 TO 3: READ a(i): NEXT i
PRINT "SET UP"
PRINT
PRINT "2, 0 and 5 game."
PRINT "("; : COLOR 15: PRINT "1"; : COLOR 7: PRINT ")Player VS Computer."
PRINT "("; : COLOR 15: PRINT "2"; : COLOR 7: PRINT ")Player VS Player."
1 t$ = INPUT$(1)
IF t$ <> "1" AND t$ <> "2" THEN LOCATE 6, 1: GOTO 1
CLS
IF t$ = "1" THEN
ss = INT(RND * 3) + 1
s = a(ss)
SLEEP 3: PRINT "Computer is ready."
2 INPUT "Input your select(0, 2 or 5):"; ys
IF ys <> 0 AND ys <> 2 AND ys <> 5 THEN GOTO 2
k = s + ys
PRINT "Computer select:"; s: PRINT "You select:"; ys
SELECT CASE k
CASE 0, 4, 10: PRINT a$
CASE 2, 7: IF s > ys THEN PRINT c$ ELSE PRINT b$
CASE 5: IF s < ys THEN PRINT c$ ELSE PRINT b$
END SELECT
ELSE
3 INPUT "Player1 select(0, 2 or 5):"; s1
IF p1 <> 0 AND p1 <> 2 AND p1 <> 5 THEN GOTO 3
CLS
PRINT "Player1 is ready."
PRINT
4 INPUT "Player2 select(0, 2 or 5):"; s2
IF p2 <> 0 AND p2 <> 2 AND p2 <> 5 THEN GOTO 4
CLS
k = s1 + s2
PRINT "Player1 select:"; s1: PRINT "Player2 select:"; s2
SELECT CASE k
CASE 0, 4, 10: PRINT a$
CASE 2, 7: IF s1 < s2 THEN PRINT d$ ELSE PRINT e$
CASE 5: IF s1 > s2 THEN PRINT d$ ELSE PRINT e$
END SELECT
END IF
PRINT "SET OFF."
END
6 楼
QB爱好者 [专家分:370] 发布于 2007-08-30 10:52:00
你们的太烦了吧!
CLS
RANDOMIZE TIMER
PRINT "1=JIANDAO,2=SHITOU,3=BU";
INPUT "",A
IF A<1 OR A>3 OR A<>INT(A) THEN ? "ERROR":END
R=INT(RND*3+1)
IF R=A THEN ? "PINGJU"
IF A=1 AND R=2 THEN X=1
IF A=1 AND R=3 THEN X=2
IF A=2 AND R=1 THEN X=2
IF A=2 AND R=3 THEN X=1
IF A=3 AND R=1 THEN X=1
IF A=3 AND R=2 THEN X=2
PRINT "YOU"
IF X=1 THEN PRINT "LOSE" ELSE PRINT "WIN"
END
7 楼
hxy_anhui [专家分:320] 发布于 2009-01-29 21:18:00
怎么那么烦呀?看我的。
CLS
RANDOMIZE TIMER
REM 1 = JIANDAO, 2 = CHUIZI, 3 = BU
INPUT N
S = INT(RND * 3 + 1)
IF N = S THEN PRINT “BU SHU BU YING!” : END
IF (S > N AND N <> 1) OR (S = 1 AND N = 3) THEN PRINT “NI SHU LE!” ELSE PRINT “NI YING LE!”
END
8 楼
冰冻小企鹅 [专家分:190] 发布于 2009-02-26 19:49:00
你们都太麻烦了,机灵点拜托!我随便一看就知道,书上找·*
9 楼
taibazi [专家分:30] 发布于 2009-04-13 21:30:00
[quote]CLS
PRINT "jian dao,bao fu ,chui you xi shuo ming:"
PRINT "jian dao: 3,bao fu: 2,chui: 1"
REM "a=int(rnd*3+1) shi ran jian nao sui ji chan sheng 1 ge shu"
a = INT(RND * 3 + 1)
PRINT
PRINT "you xi kai shi,ni zhui bei hao le ma?"
PRINT
PRINT "dian nao yi jing zhun bei hao!"
100 INPUT "gai ni chu le(1 or 2 or 3):", b
IF b > 3 OR b < 1 THEN PRINT "ni zhen ben,chong xi shu ru:": GOTO 100
IF a = b THEN PRINT "ping ju,qing zai lai 1 ju ba!": END
IF a > b AND a - b = 1 THEN
PRINT "dian nao chu:"; a, "ni chu:"; b, "ni shu la,hai gan tiao zhan ma?": END
END IF
IF a > b AND a - b = 2 THEN
PRINT "dian nao chu:"; a, "ni chu:"; b, "ni yin la,ni zheng bang!": END
END IF
IF a < b AND a - b = -1 THEN
PRINT "dian nao chu:"; a, "ni chu:"; b, "ni yin la,ni zheng bang!": END
END IF
IF a < b AND a - b = -2 THEN
PRINT "dian nao chu:"; a, "ni chu:"; b, "ni shu la,hai gan tiao zhan ma?": END
END IF
[/quote]
我每次输1,它每次输
10 楼
1054122 [专家分:750] 发布于 2009-04-17 22:54:00
绝对公平的
CLS
INPUT x$
WHILE x$ <> "end"
PRINT "jiandao or shitou or bu"
INPUT a$
IF a$ = "jiandao" THEN
a = 1
END IF
IF a$ = "shitou" THEN
a = 2
END IF
IF a$ = "bu" THEN
a = 3
END IF
RANDOMIZE TIMER
b = INT(RND * 3) + 1
IF a = b THEN
PRINT "ping"
END IF
IF a = 1 AND b = 2 THEN PRINT "ni-shu-le"
IF a = 1 AND b = 3 THEN PRINT "ni-ying-le"
IF a = 2 AND b = 1 THEN PRINT "ni=ying-le"
IF a = 2 AND b = 3 THEN PRINT "ni-shu-le"
IF a = 3 AND b = 1 THEN PRINT "ni-shu-le"
IF a = 3 AND b = 2 THEN PRINT "ni-ying-le"
INPUT x$
WEND
END
我来回复