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/22 21:18:32

MixJuice GET URL : kidspod.club/mj/76

ヒトフデガキモドキ

好きな歩数を入力して数字の上を歩いて全部0にできたらクリアです

SOURCE CODE

1 'ヒトフテ゛カ゛キモト゛キ
10 CLS:CLV:X=RND(5):Y=RND(5):[Y*10+X]=1:U=X:V=Y:O=200
15 ?"ヒトフテ゛カ゛キ":INPUT "ナンホ゜イキマスカ?",L
20 FOR I=0 TO L-1:D=RND(4)
30 LET X,X+(D/2=0)*(D%2*2-1)
40 LET Y,Y+(D/2=1)*(D%2*2-1)
50 IFX<0X=1
60 IFX>4X=3
70 IFY<0Y=1
80 IFY>4Y=3
90 LET[Y*10+X],[Y*10+X]+1:NEXT
95 LCU*2+10,V*2+5:?"[ ]"
100 FORY=0TO4
110 FORX=0TO4:LCX*2+11,Y*2+5:?[Y*10+X];:NEXT:?
120 NEXT
150 LC0,0:?"READY・・・":WAIT 100:LC0,0:?"START !!":LC11,18:?"SCORE ";S:CLT
160 LCU*2+11,V*2+5:?"(#F9)":BEEP:PLAY:BEEP
200 IF L=0 LC11,16:?"CLEAR!!":PLAY"T300CDFA":END
210 LC0,2:?O-TICK();" ":K=INKEY():IF K>27 AND K<32 GOTO220 ELSE IF TICK()>O LC11,16:?"GAME OVER":END ELSE GOTO210
220 LETS,S+O-TICK():LC11,18:?"SCORE ";S:CLT:[V*10+U]=[V*10+U]-1:LCU*2+11,V*2+5:?[V*10+U]:BEEP
240 U=U+(U<4)*(K=29)-(U>0)*(K=28)
250 V=V+(V<4)*(K=31)-(V>0)*(K=30)
290 IF [10*V+U]>0 L=L-1:GOTO160 ELSE LC11,16:?"GAME OVER":END

COMMENT