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

2016/08/07 17:58:27

MixJuice GET URL : kidspod.club/mj/96

4方向マクラ投げ

上下左右から飛んでくる枕を矢印キーでよけつつ
テンキーで撃ちまくって下さい

SOURCE CODE

1 '4DIR MAKURANAGE
10 CLV:CLS
20 X=16:Y=12:T=2:Z=10:LCX,Y:?"@":LC20,0:?"SCORE:";S:LC9,0:?"MAKURA:";Z
30 LET[0],0,1,-1,0,1,0,0,-1
40 LET[8],-1,1,0,0,0,0,-1,1,30,0,0,0,0,0,23,0
100 K=INKEY():U=X:V=Y:LC16,0:?Z;"  ":R=R+1:IF R=10 Z=Z+1:R=0
110 IFK=28ANDX>0X=X-1:M=1
120 IFK=29ANDX<31X=X+1:M=1
130 IFK=31ANDY<23Y=Y+1:M=1
140 IFK=30ANDY>1Y=Y-1:M=1
150 IFVPEEK(X,Y)=36 GOTO500
160 IFMLCX,Y:?"@";:LCU,V:?" ";:M=0
200 FORI=0TOT
210 IFK>49ANDK<57ANDN=0ANDZ>0K=K/2*2:A=X:B=Y:N=1:P=[K-50]:Q=[K-49]:Z=Z-1
220 IFNANDA>-1ANDA<30ANDB>1ANDB<23ANDZ>0A=A+P:B=B+Q:C=VPEEK(A,B):LCA,B:?"O";:LCA-P,B-Q:?" ";ELSEN=0:C=0:LCA,B:?" ";
222 IFX=A-PANDY=B-Q:LCX,Y:?"@";
225 IFC=36S=S+1:Z=Z+1:LC20,0:?"SCORE:";S:N=0:M=1:BEEP
227 NEXT
230 IFL=0O=RND(4):R=RND(3)-1:IFO/2[16+O]=X+RELSE[20+O]=Y+R
235 IFL=0D=[16+O]:E=[20+O]:G=[8+O]:H=[12+O]:L=1
240 IFL=1ANDD>-1ANDD<31ANDE>-1ANDE<24D=D+G:E=E+H:F=VPEEK(D,E):LCD,E:?"$"; ELSE L=0:F=0
250 IFF=64 GOTO500
310 M=0:GOTO100
500 LC10,16:?"GAME OVER":PLAY"C16R16C8R8A":END

COMMENT