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

2020/05/05 23:59:53

MixJuice GET URL : kidspod.club/mj/963

箱入り娘 (IchigoJam BASIC 1.3~)

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

SOURCE CODE

CLS:'

NEW

POKE#F60,255,128,128,128,128,128,128,128
POKE#F68,255,1,1,1,1,1,1,1
POKE#F70,128,128,128,128,128,128,128,255
POKE#F78,1,1,1,1,1,1,1,255
POKE#F80,255,129,129,129,129,129,129,129
POKE#F90,129,129,129,129,129,129,129,255
POKE#FA0,255,128,128,128,128,128,128,255
POKE#FA8,255,1,1,1,1,1,1,255
POKE#FC0,255,129,129,129,129,129,129,255
POKE#FE0,240,0,241,0,242,0,243,0
POKE#FE8,244,0,0,0,246,0,0,0
POKE#FF0,248,0,249,0,0,0,0,0
POKE#FF8,252,0,0,0,0,0,0,0

10 'Klotski
20 VIDEO 6:CLS
30 COPY #780,#F60,160
40 ?CHR$(244,240,241,244)
50 ?CHR$(246,242,243,246)
60 ?CHR$(244,248,249,244)
70 ?CHR$(246,252,252,246)
80 ?CHR$(252,1,1,252)
90 ?CHR$(0,2,2,0);
100 X=2:Y=4:M=0
110 LC X,Y,1
120 K=INKEY():IF !K CONT
130 IF K<>32 GOTO 150
140 M=1-M:?CHR$(17);:GOTO 120
150 IF !M GOTO 370
160 P=SCR(X,Y):IF P=1 GOTO 370
170 P=P-240:Q=P%4:P=P-Q
180 A=X-Q%2:B=Y-Q/2
190 FOR S=0 TO 3
200 IF ![P+S] GOTO 220
210 LC A+S%2,B+S/2:?CHR$(1)
220 NEXT
230 C=A-(K=28)+(K=29)
240 D=B-(K=30)+(K=31):N=0
250 FOR S=0 TO 3
260 IF ![P+S] GOTO 280
270 IF SCR(C+S%2,D+S/2)<>1 N=1
280 NEXT
290 IF N=1 C=A:D=B
300 FOR S=0 TO 3
310 IF ![P+S] GOTO 340
320 LC C+S%2,D+S/2
330 ?CHR$([P+S])
340 NEXT
350 IF SCR(1,3)<>240 GOTO 370
360 LC 3,5:END
370 X=(X-(K=28)+(K=29)+4)%4
380 Y=(Y-(K=30)+(K=31)+5)%5
390 GOTO 110

'OK

COMMENT

Kidspod運営チーム
Kidspod運営チーム2020/05/11 16:25:01

掴んで離すという操作性がいいですね。掴んだ後のカーソルが移動できる範囲に制限があると、もっと分かりやすかったかも。