5/26 プログラミング寺子屋@小樽

オリジナルプログラム:斎藤 史郎氏 2015年制作
https://www.ichigojaman.jp/entry/20150404/1428459049


10 ‘SHOOTING
20 CLS:CLV
30 LOCATE 0,0
40 PRINT S
50 X=15:Y=22
60 LOCATE X,Y
70 PRINT “A”;
72 U=RND(31):V=0
74 LOCATE U,V
76 PRINT CHR$(241);
80 ‘GAMELOOP
90 LOCATE X,Y
100 PRINT ” “;
110 IF BTN(LEFT)=1 AND X>0 THEN X=X-1
120 IF BTN(RIGHT)=1 AND X<31 THEN X=X+1
130 LOCATE X,Y
140 PRINT “A”;
142 IF BTN(SPACE)=1 THEN GOSUB 240
145 GOSUB 160
150 IF V<22 THEN GOTO 80
152 BEEP 30,30
154 LOCATE 12,12
156 PRINT “GAME OVER”
158 END
160 ‘*UFO 170 LOCATE U,V
180 PRINT ” “;
190 U=U+RND(3)-1
192 IF U<0 THEN U=0
194 IF U>31 THEN U=31
200 V=V+RND(3)-1
201 IF RND(10)=0 THEN V=V+1
202 IF V<1 THEN V=1
204 IF V>22 THEN V=22
210 LOCATE U,V
220 PRINT CHR$(241);
230 RETURN
240 ‘BEAM
250 B=X
260 FOR C=Y-1 TO V STEP -1
270 LOCATE B,C
280 PRINT “|”;
285 WAIT 2
290 LOCATE B,C
300 PRINT ” “;
310 NEXT
320 IF B<>U THEN RETURN
330 ‘HIT
340 BEEP
350 LOCATE U,V
360 PRINT “”;
362 S=S+10
364 LOCATE 0,0
366 PRINT S
370 WAIT 20
380 LOCATE U,V
390 PRINT ” “;
395 U=RND(20):V=0
400 RETURN