home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
mbug
/
mbug096.arc
/
PATTERN.WSF
< prev
next >
Wrap
Text File
|
1979-12-31
|
4KB
|
78 lines
-- PATTERN --
by Simon Carter
Pattern produces (obviously) patterns on the screen. It does this
by placing PCG characters on the screen, clearing them and POKEing
values into them with a few complicated statements. Because these
characters are at several locations on the screen, all of them
change at the same time. A screen dump facility for parallel
printers is included, to operate it press <P>. Remember to type
in line 00100 as is and not put any lines before it.
00100 REM 12345678901234
00110 GOSUB 410
00120 D=63488+Y+(PEEK((B-1)*64+A+61439)-128)*16
00130 Z7$="0":H=128:P=PEEK(D):FOR J=1 TO 8
00140 IF P=>H:Z7$=Z7$+"1":P=P-H ELSE LET Z7$=Z7$+"0"
00150 H=H/2:NEXT J:Z7$=Z7$+"0"
00160 C=11-X:IF Z7$(;C,C)="1":Z7$=Z7$(;1,C-1)+"0"+Z7$(;C+1,10) ELSE LET Z7$=Z7$(;1,C-1)+"1"+Z7$(;C+1,10)
00170 W=1:V=0:R=0:H=128:FOR T=2 TO 9
00180 IF Z7$(;T,T)="1":R=R+H:V=V+W
00190 W=W*2:H=H/2:NEXT T:POKE D,R
00200 POKE 63503-Y+(PEEK((16-B)*64+A+61439)-128)*16,R
00210 POKE 63488+Y+(PEEK((B-1)*64+(65-A)+61439)-128)*16,V
00220 POKE 63503-Y+(PEEK((16-B)*64+(65-A)+61439)-128)*16,V
00230 I=INT(RND*8)+1
00240 IF I=1 OR I=5 OR I=7:X=X-1
00250 IF I=2 OR I=6 OR I=8:X=X+1
00260 IF I=3 OR I=5 OR I=6:Y=Y+1
00270 IF I=4 OR I=7 OR I=8:Y=Y-1
00280 IF X>9:X=2:A=A-1
00290 IF X<2:X=9:A=A+1
00300 IF Y>15:Y=0:B=B+1
00310 IF Y<0:Y=15:B=B-1
00320 IF A>32:A=25:X=9
00330 IF A<25:A=32:X=2
00340 IF B>11:B=9:Y=0
00350 IF B<9:B=11:Y=15
00360 K1$=KEY:IF K1$="" THEN 120
00370 IF K1$<>"P" THEN 120
00380 OUTL#1
00390 U=USR(30000)
00400 GOTO 120
00410 POKE 220,255:PRINT:UNDERLINE:INVERSE:NORMAL
00420 K=2:GOSUB 460:K=3:GOSUB 490:GOSUB 460:GOSUB 490:GOSUB 460:K=2:GOSUB 490
00430 FOR I=2310 TO 2323:READ D:POKE I,D:NEXT I:U=USR(2310)
00440 FOR A=30000 TO 30174:READ B:POKE A,B:NEXT A
00450 X=5:Y=8:A=28:B=10:RETURN
00460 IF K=3:FOR L=1 TO 4:FOR I=176 TO 183:POKE 61440+P,I:P=P+1:NEXT I:FOR I=152 TO 159:POKE 61440+P,I:P=P+1:NEXT I:NEXT L
00470 FOR L=1 TO 4:FOR I=184 TO 191:POKE 61440+P,I:P=P+1:NEXT I:FOR I=160 TO 167:POKE 61440+P,I:P=P+1:NEXT I:NEXT L
00480 FOR L=1 TO 4:FOR I=192 TO 199:POKE 61440+P,I:P=P+1:NEXT I:FOR I=168 TO 175:POKE 61440+P,I:P=P+1:NEXT I:NEXT L:RETURN
00490 FOR L=1 TO 4:FOR I=200 TO 207:POKE 61440+P,I:P=P+1:NEXT I:FOR I=128 TO 135:POKE 61440+P,I:P=P+1:NEXT I:NEXT L
00500 FOR L=1 TO 4:FOR I=208 TO 215:POKE 61440+P,I:P=P+1:NEXT I:FOR I=136 TO 143:POKE 61440+P,I:P=P+1:NEXT I:NEXT L
00510 IF K=3:FOR L=1 TO 4:FOR I=216 TO 223:POKE 61440+P,I:P=P+1:NEXT I:FOR I=144 TO 151:POKE 61440+P,I:P=P+1:NEXT I:NEXT L
00520 RETURN
00530 DATA 33,0,248,17,1,248,1,255,5,54,0,237,176,201
00540 DATA 245,197,213,229,62,27,205,69,128,62
00550 DATA 65,205,69,128,62,7,205,69,128,33,0
00560 DATA 240,6,16,197,229,229,17,0,240,14
00570 DATA 0,225,62,27,205,69,128,62,75,205
00580 DATA 69,128,175,205,69,128,62,2,205,69
00590 DATA 128,6,64,24,2,24,222,197,213,126
00600 DATA 254,128,56,11,245,62,144,211,28,126
00610 DATA 246,128,211,28,241,35,229,38,0,111
00620 DATA 41,41,41,41,25,62,1,211,11,6
00630 DATA 8,17,128,0,197,6,8,229,126,163
00640 DATA 40,1,63,203,18,35,16,246,225,203
00650 DATA 27,122,205,69,128,22,0,193,16
00660 DATA 230,175,211,11,225,209,193,16,185
00670 DATA 62,13,205,69,128,62,10,205,69
00680 DATA 128,17,8,240,121,14,1,183,40,140
00690 DATA 193,205,9,128,40,4,254,3,40,2
00700 DATA 16,152,62,27,205,69,128,62,50,205
00710 DATA 69,128,225,209,193,241,201
690 DATA 193,205,9,128,40,4,254,3,40,2
00700 DATA 16,152,62,27,205,69,128,62,50