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/04 14:37:18

MixJuice GET URL : kidspod.club/mj/961

お絵かきロジック (IchigoJam BASIC 1.3~)

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

SOURCE CODE

CLS:'

NEW

10 'Picture Logic
20 IF A<224 A=RND(32)+224
30 CLS:VIDEO 3
40 FOR Y=0 TO 7:C=219
50 ?CHR$(C,C,C,C,C,C,C,C);
60 C=0:D=PEEK(A*8+Y)
70 IF D&128 C=C+1:GOTO 90
80 IF C ?C;:C=0
90 D=D<<1:IF D GOTO 70
100 IF C ?C;
110 ?:NEXT
120 FOR X=0 TO 7:B=8:C=0
130 FOR Y=0 TO 7
140 D=PEEK(A*8+Y)<<X
150 IF D&128 C=C+1:GOTO 170
160 IF C LC X,B:?C;:B=B+1:C=0
170 NEXT
180 IF C LC X,B:?C;
190 NEXT
200 COPY #800,A*8,8
210 COPY A*8,0,8
220 X=4:Y=4:LC 13,0:?CHR$(A)
230 O=0:FOR C=0 TO 7
240 D=PEEK(#800+C)
250 IF D=PEEK(A*8+C) O=O+1
260 NEXT
270 IF INKEY() CONT
280 IF O=8 CLK:A=0:LC 14,9:END
290 LC X,Y,1
300 K=INKEY():IF !K CONT
310 X=(X-(K=28)+(K=29)+8)%8
320 Y=(Y-(K=30)+(K=31)+8)%8
330 IF K<>32 GOTO 410
340 IF SCR(X,Y)<>219 GOTO 360
350 ?CHR$(2,28);:GOTO 380
360 IF SCR(X,Y)<>2 GOTO 270
370 ?CHR$(219,28);
380 C=PEEK(A*8+Y)
390 POKE A*8+Y,C^(1<<(7-X))
400 GOTO 230
410 IF(K<>88)*(X<>120)GOTO 270
420 IF SCR(X,Y)<>219 GOTO 440
430 ?CHR$(120,28);:GOTO 270
440 IF SCR(X,Y)<>120 GOTO 270
450 ?CHR$(219,28);:GOTO 270

'OK

COMMENT