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

2018/09/25 22:49:27

MixJuice GET URL : kidspod.club/mj/608

New 迷路(BASIC 1.2.2~)

詳細は イチゴジャム レシピ で公開しています。
「プログラムをみる」を参照して下さい。

SOURCE CODE

CLS

NEW

10 'New MAZE
20 VIDEO 1:CLS:CLV:CLP
30 FOR X=2 TO 28
40 LC X, 4:?CHR$(1)
50 LC X,20:?CHR$(1):NEXT
60 FOR Y=4 TO 20
70 LC  2,Y:?CHR$(1)
80 LC 28,Y:?CHR$(1):NEXT
90 FOR X=4 TO 26 STEP 2
100 FOR Y=6 TO 18 STEP 2
110 LC X,Y:?CHR$(1)
120 R=RND(4)
130 A=X-(R=0)+(R=1)
140 B=Y-(R=2)+(R=3)
150 LC A,B:?CHR$(1):NEXT:NEXT
160 LC 3,5:?"S"
170 LC 27,19:?CHR$(3)
180 IF !BTN(SPACE) GOTO 180
190 VIDEO 5:X=3:Y=5
200 FOR B=-2 TO 2
210 C=#900+(Y+B)*32+X-3
220 COPY #900+(B+2)*8,C,7:NEXT
230 LC 3,2:?CHR$(249);
240 IF X=27 AND Y=19 END
250 LC 0,5
260 IF PEEK(#1002) GOTO 260
270 A=X-(BTN(LEFT))
280 A=A+(BTN(RIGHT))
290 B=Y-(BTN(UP))+(BTN(DOWN))
300 IF A=X AND B=Y GOTO 270
310 C=#900+B*32+A
320 IF PEEK(C)=1 GOTO 270
330 X=A:Y=B:GOTO 200

'OK

COMMENT