Enjoy programming more!
Kidspod is a post site which supports young programmers.
First step to join us.
Register as a member
For members

2016/05/21 19:04:27

MixJuice GET URL : kidspod.club/mj/72

ヤキュウバン

ichigojamを野球盤にします。ただし打つだけなのでスコアやランナー、アウトカウントとかは紙に書いたりして遊んでください。

SOURCE CODE

1 'ヤキュウハ゛ン
10 CLS
30 LC 5,11:?"PUSH ANY KEY"
100 X=16:Y=10:V=7+RND(8):U=20:W=RND(3)-1:B=0
105 IF INKEY()=0 GOTO 105
106 LC 5,11:CLS:CLT
110 K=INKEY():LC X-1,Y-1:?"   ":LC X,Y:?"O":Y=V*TICK()/30+10:X=TICK()*W/20+16
115 IF K=(32) BEEP:LED1
120 IF Y>24 IF B=0 IF X<15 OR X>17 LC5,11:?"BALL":GOTO320 ELSE LC 5,11:?"STIKE":GOTO320
123 IF Y>23 LC 0,22:C=TICK():LED1
125 K=INKEY():IF K=(32) B=TICK():IF ABS(B-C)>10 GOTO320 ELSE LC0,22:?C;:?B:GOTO150
130 LED0:GOTO110
150 T=X:W=(B-C+16-X)*4:V=15-ABS(B-C)*3+RND(6):CLT
160 Y=-V*TICK()/25+23:X=W*TICK()/20+T
170 LC X,Y:?"O":'LC X-3,Y:?"       "
175 IF Y<ABS(X-16)/2+3 AND B=C*RND(3) PLAY"T400FGA":LC 5,11:?"HOME RUN":GOTO100
176 IF Y<5 IF ABS(B-C)<3 LC5,11:?"DOUBLE!":GOTO100 ELSE ?"HIT"
180 IF Y<1 GOTO 100
181 IF X<1 IF Y<8 LC 5,11:?"HIT" ELSE LC 5,11:?"FOUL":BEEP0:GOTO 100
182 IF X>31 IF Y<8 LC 5,11:?"HIT" ELSE LC 5,11:?"FOUL":BEEP0:GOTO 100
183 IF TICK()>30 IF ABS(B-C)>1 LC5,11:?"OUT":GOTO100 ELSE LC 5,11:?"HIT":GOTO 100
190 GOTO 160
320 LC5,11:?"STRIKE":LC 0,22:?C;:?B:GOTO100

COMMENT