主题:[讨论]剪刀石头步
YF99_66
[专家分:30] 发布于 2007-08-06 17:14:00
谁来发!
回复列表 (共5个回复)
沙发
wzc1996 [专家分:1680] 发布于 2007-08-06 19:42: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
板凳
FFKK [专家分:1610] 发布于 2009-09-27 20:42:00
上面那位不能随机只能让电脑出三
看我的
CLS
RANDOMIZE TIMER
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
[em5][em4][em4][em4][em4][em4][em9][em9]
3 楼
phile [专家分:2310] 发布于 2009-09-28 19:00:00
额
4 楼
1054122 [专家分:750] 发布于 2009-10-01 13:18: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]
汗,这就用GOTO
CLS
INPUT "end or start", x$
WHILE x$ <> "end" AND a$ <> "end" AND x$ = "start" AND x$ = "Start"
INPUT "What are you? rock, scissors, cloth? ", a$
IF a$ = "scissors" THEN
a = 1
END IF
IF a$ = "rock" THEN
a = 2
END IF
IF a$ = "cloth" THEN
a = 3
END IF
RANDOMIZE TIMER
b = INT(RND * 3) + 1
IF a = b THEN
PRINT "Draw"
END IF
IF a = 1 AND b = 2 THEN PRINT "You lose the"
IF a = 1 AND b = 3 THEN PRINT "You win"
IF a = 2 AND b = 1 THEN PRINT "You win"
IF a = 2 AND b = 3 THEN PRINT "You lose the"
IF a = 3 AND b = 1 THEN PRINT "You lose the"
IF a = 3 AND b = 2 THEN PRINT "You win"
WEND
END
5 楼
593170024 [专家分:500] 发布于 2009-10-27 22:40:00
[quote][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]
汗,这就用GOTO,GOTO快,又没讲不能用
CLS
INPUT "end or start", x$
WHILE x$ <> "end" AND a$ <> "end" AND x$ = "start" AND x$ = "Start"
INPUT "What are you? rock, scissors, cloth? ", a$
IF a$ = "scissors" THEN
a = 1
END IF
IF a$ = "rock" THEN
a = 2
END IF
IF a$ = "cloth" THEN
a = 3
END IF
RANDOMIZE TIMER
b = INT(RND * 3) + 1
IF a = b THEN
PRINT "Draw"
END IF
IF a = 1 AND b = 2 THEN PRINT "You lose the"
IF a = 1 AND b = 3 THEN PRINT "You win"
IF a = 2 AND b = 1 THEN PRINT "You win"
IF a = 2 AND b = 3 THEN PRINT "You lose the"
IF a = 3 AND b = 1 THEN PRINT "You lose the"
IF a = 3 AND b = 2 THEN PRINT "You win"
WEND
END[/quote]
[em12]
我就用GOTO
DO
RANDOMIZE TIMER
12
CLS
PRINT "jian dao,bu,shi to you xi shuo ming:"
PRINT "jian dao: 3,bu: 2,shi to: 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!": d$ = INPUT$(1): GOTO 12
IF a > b AND a - b = 1 THEN
PRINT "dian nao chu:"; a, "ni chu:"; b, "ni shu la,ben dan hai gan tiao zhan ma?": d$ = INPUT$(1): GOTO 12
END IF
IF a > b AND a - b = 2 THEN
PRINT "dian nao chu:"; a, "ni chu:"; b, "ni yin la,ni zheng bang!": d$ = INPUT$(1): GOTO 12
END IF
IF a < b AND a - b = -1 THEN
PRINT "dian nao chu:"; a, "ni chu:"; b, "ni yin la,ni zheng bang!": d$ = INPUT$(1): GOTO 12
END IF
IF a < b AND a - b = -2 THEN
PRINT "dian nao chu:"; a, "ni chu:"; b, "ni shu la, ben dan hai gan tiao zhan ma?": d$ = INPUT$(1): GOTO 12
END IF
LOOP
我来回复