Home » Archimedes archive » Acorn User » AU 1997-09 B.adf » Regulars » StarInfo/Mellor/Carpet
StarInfo/Mellor/Carpet
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » Archimedes archive » Acorn User » AU 1997-09 B.adf » Regulars |
Filename: | StarInfo/Mellor/Carpet |
Read OK: | ✔ |
File size: | 0646 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
10REM Psychodelic Carpet! 20REM By Philip Mellor (age 15) 30REM Acorn User/Star Info 40: 50MODE 15:OFF 60DIM c(32,32,2),a(3,2) 70FOR x=0 TO 32 80FOR y=0 TO 32 90c(x,y,2)=RND(255) 100c(x,y,1)=RND(255) 110c(x,y,0)=255 120NEXT 130NEXT 140: 150FOR x=0 TO 31 160FOR y=0 TO 31 170a(0,0)=c(x,y,0):a(0,1)=c(x,y,1):a(0,2)=c(x,y,2) 180a(1,0)=c(x+1,y,0):a(1,1)=c(x+1,y,1):a(1,2)=c(x+1,y,2) 190a(2,0)=c(x,y+1,0):a(2,1)=c(x,y+1,1):a(2,2)=c(x,y+1,2) 200a(3,0)=c(x+1,y+1,0):a(3,1)=c(x+1,y+1,1):a(3,2)=c(x+1,y+1,2) 210r1s=(a(0,0)-a(2,0))/32 220g1s=(a(0,1)-a(2,1))/32 230b1s=(a(0,2)-a(2,2))/32 240r2s=(a(1,0)-a(3,0))/32 250g2s=(a(1,1)-a(3,1))/32 260b2s=(a(1,2)-a(3,2))/32 270ORIGIN x*40,y*32 280FOR p=0 TO 32 STEP 4 290PROCblendH((r1s*p)+a(2,0),g1s*p+a(2,1),b1s*p+a(2,2),r2s*p+a(3,0),g2s*p+a(3,1),b2s*2+a(3,2),40,40,32-p,0,32-p) 300NEXT 310NEXT 320NEXT 330: 340END 350: 360DEFPROCblendV(r1,g1,b1,r2,g2,b2,num,bx,by,tx,ty) 370LOCAL step,rstep,gstep,bstep,i,set_gcol% 380SYS "OS_SWINumberFromString",,"ColourTrans_SetGCOL" TO set_gcol% 390step=(ty-by)/num 400rstep=(r1-r2)/num 410gstep=(g1-g2)/num 420bstep=(b1-b2)/num 430FOR i=0 TO num 440r=(rstep*i)+r2 450g=(gstep*i)+g2 460b=(bstep*i)+b2 470SYS set_gcol%,(r<<8)+(g<<16)+(b<<24),,,&100,0 480RECTANGLE FILL bx,(i*step)+by,tx-bx,step 490NEXT 500ENDPROC 510: 520DEFPROCblendH(r1,g1,b1,r2,g2,b2,num,bx,by,tx,ty) 530LOCAL step,rstep,gstep,bstep,i,set_gcol% 540SYS "OS_SWINumberFromString",,"ColourTrans_SetGCOL" TO set_gcol% 550step=(tx-bx)/num 560rstep=(r1-r2)/num 570gstep=(g1-g2)/num 580bstep=(b1-b2)/num 590FOR i=0 TO num 600r=(rstep*i)+r2 610g=(gstep*i)+g2 620b=(bstep*i)+b2 630SYS set_gcol%,(r<<8)+(g<<16)+(b<<24),,,&100,0 640RECTANGLE FILL (i*step)+bx,by,step,ty-by 650NEXT 660ENDPROC
� Psychodelic Carpet! � By Philip Mellor (age 15) � Acorn User/Star Info (: 2 � 15:� <� c(32,32,2),a(3,2) F� x=0 � 32 P� y=0 � 32 Zc(x,y,2)=�(255) dc(x,y,1)=�(255) nc(x,y,0)=255 x� �� �: �� x=0 � 31 �� y=0 � 31 �3a(0,0)=c(x,y,0):a(0,1)=c(x,y,1):a(0,2)=c(x,y,2) �9a(1,0)=c(x+1,y,0):a(1,1)=c(x+1,y,1):a(1,2)=c(x+1,y,2) �9a(2,0)=c(x,y+1,0):a(2,1)=c(x,y+1,1):a(2,2)=c(x,y+1,2) �?a(3,0)=c(x+1,y+1,0):a(3,1)=c(x+1,y+1,1):a(3,2)=c(x+1,y+1,2) �r1s=(a(0,0)-a(2,0))/32 �g1s=(a(0,1)-a(2,1))/32 �b1s=(a(0,2)-a(2,2))/32 �r2s=(a(1,0)-a(3,0))/32 �g2s=(a(1,1)-a(3,1))/32 b2s=(a(1,2)-a(3,2))/32 ȑ x*40,y*32 � p=0 � 32 � 4 "n�blendH((r1s*p)+a(2,0),g1s*p+a(2,1),b1s*p+a(2,2),r2s*p+a(3,0),g2s*p+a(3,1),b2s*2+a(3,2),40,40,32-p,0,32-p) ,� 6� @� J: T� ^: h/��blendV(r1,g1,b1,r2,g2,b2,num,bx,by,tx,ty) r(� step,rstep,gstep,bstep,i,set_gcol% |Bș "OS_SWINumberFromString",,"ColourTrans_SetGCOL" � set_gcol% �step=(ty-by)/num �rstep=(r1-r2)/num �gstep=(g1-g2)/num �bstep=(b1-b2)/num �� i=0 � num �r=(rstep*i)+r2 �g=(gstep*i)+g2 �b=(bstep*i)+b2 �0ș set_gcol%,(r<<8)+(g<<16)+(b<<24),,,&100,0 �#ȓ Ȑ bx,(i*step)+by,tx-bx,step �� �� �: /��blendH(r1,g1,b1,r2,g2,b2,num,bx,by,tx,ty) (� step,rstep,gstep,bstep,i,set_gcol% Bș "OS_SWINumberFromString",,"ColourTrans_SetGCOL" � set_gcol% &step=(tx-bx)/num 0rstep=(r1-r2)/num :gstep=(g1-g2)/num Dbstep=(b1-b2)/num N� i=0 � num Xr=(rstep*i)+r2 bg=(gstep*i)+g2 lb=(bstep*i)+b2 v0ș set_gcol%,(r<<8)+(g<<16)+(b<<24),,,&100,0 �#ȓ Ȑ (i*step)+bx,by,step,ty-by �� �� �
00000000 0d 00 0a 19 f4 20 50 73 79 63 68 6f 64 65 6c 69 |..... Psychodeli| 00000010 63 20 43 61 72 70 65 74 21 0d 00 14 1f f4 20 42 |c Carpet!..... B| 00000020 79 20 50 68 69 6c 69 70 20 4d 65 6c 6c 6f 72 20 |y Philip Mellor | 00000030 28 61 67 65 20 31 35 29 0d 00 1e 1a f4 20 41 63 |(age 15)..... Ac| 00000040 6f 72 6e 20 55 73 65 72 2f 53 74 61 72 20 49 6e |orn User/Star In| 00000050 66 6f 0d 00 28 05 3a 0d 00 32 0a eb 20 31 35 3a |fo..(.:..2.. 15:| 00000060 87 0d 00 3c 17 de 20 63 28 33 32 2c 33 32 2c 32 |...<.. c(32,32,2| 00000070 29 2c 61 28 33 2c 32 29 0d 00 46 0e e3 20 78 3d |),a(3,2)..F.. x=| 00000080 30 20 b8 20 33 32 0d 00 50 0e e3 20 79 3d 30 20 |0 . 32..P.. y=0 | 00000090 b8 20 33 32 0d 00 5a 13 63 28 78 2c 79 2c 32 29 |. 32..Z.c(x,y,2)| 000000a0 3d b3 28 32 35 35 29 0d 00 64 13 63 28 78 2c 79 |=.(255)..d.c(x,y| 000000b0 2c 31 29 3d b3 28 32 35 35 29 0d 00 6e 10 63 28 |,1)=.(255)..n.c(| 000000c0 78 2c 79 2c 30 29 3d 32 35 35 0d 00 78 05 ed 0d |x,y,0)=255..x...| 000000d0 00 82 05 ed 0d 00 8c 05 3a 0d 00 96 0e e3 20 78 |........:..... x| 000000e0 3d 30 20 b8 20 33 31 0d 00 a0 0e e3 20 79 3d 30 |=0 . 31..... y=0| 000000f0 20 b8 20 33 31 0d 00 aa 33 61 28 30 2c 30 29 3d | . 31...3a(0,0)=| 00000100 63 28 78 2c 79 2c 30 29 3a 61 28 30 2c 31 29 3d |c(x,y,0):a(0,1)=| 00000110 63 28 78 2c 79 2c 31 29 3a 61 28 30 2c 32 29 3d |c(x,y,1):a(0,2)=| 00000120 63 28 78 2c 79 2c 32 29 0d 00 b4 39 61 28 31 2c |c(x,y,2)...9a(1,| 00000130 30 29 3d 63 28 78 2b 31 2c 79 2c 30 29 3a 61 28 |0)=c(x+1,y,0):a(| 00000140 31 2c 31 29 3d 63 28 78 2b 31 2c 79 2c 31 29 3a |1,1)=c(x+1,y,1):| 00000150 61 28 31 2c 32 29 3d 63 28 78 2b 31 2c 79 2c 32 |a(1,2)=c(x+1,y,2| 00000160 29 0d 00 be 39 61 28 32 2c 30 29 3d 63 28 78 2c |)...9a(2,0)=c(x,| 00000170 79 2b 31 2c 30 29 3a 61 28 32 2c 31 29 3d 63 28 |y+1,0):a(2,1)=c(| 00000180 78 2c 79 2b 31 2c 31 29 3a 61 28 32 2c 32 29 3d |x,y+1,1):a(2,2)=| 00000190 63 28 78 2c 79 2b 31 2c 32 29 0d 00 c8 3f 61 28 |c(x,y+1,2)...?a(| 000001a0 33 2c 30 29 3d 63 28 78 2b 31 2c 79 2b 31 2c 30 |3,0)=c(x+1,y+1,0| 000001b0 29 3a 61 28 33 2c 31 29 3d 63 28 78 2b 31 2c 79 |):a(3,1)=c(x+1,y| 000001c0 2b 31 2c 31 29 3a 61 28 33 2c 32 29 3d 63 28 78 |+1,1):a(3,2)=c(x| 000001d0 2b 31 2c 79 2b 31 2c 32 29 0d 00 d2 1a 72 31 73 |+1,y+1,2)....r1s| 000001e0 3d 28 61 28 30 2c 30 29 2d 61 28 32 2c 30 29 29 |=(a(0,0)-a(2,0))| 000001f0 2f 33 32 0d 00 dc 1a 67 31 73 3d 28 61 28 30 2c |/32....g1s=(a(0,| 00000200 31 29 2d 61 28 32 2c 31 29 29 2f 33 32 0d 00 e6 |1)-a(2,1))/32...| 00000210 1a 62 31 73 3d 28 61 28 30 2c 32 29 2d 61 28 32 |.b1s=(a(0,2)-a(2| 00000220 2c 32 29 29 2f 33 32 0d 00 f0 1a 72 32 73 3d 28 |,2))/32....r2s=(| 00000230 61 28 31 2c 30 29 2d 61 28 33 2c 30 29 29 2f 33 |a(1,0)-a(3,0))/3| 00000240 32 0d 00 fa 1a 67 32 73 3d 28 61 28 31 2c 31 29 |2....g2s=(a(1,1)| 00000250 2d 61 28 33 2c 31 29 29 2f 33 32 0d 01 04 1a 62 |-a(3,1))/32....b| 00000260 32 73 3d 28 61 28 31 2c 32 29 2d 61 28 33 2c 32 |2s=(a(1,2)-a(3,2| 00000270 29 29 2f 33 32 0d 01 0e 10 c8 91 20 78 2a 34 30 |))/32...... x*40| 00000280 2c 79 2a 33 32 0d 01 18 12 e3 20 70 3d 30 20 b8 |,y*32..... p=0 .| 00000290 20 33 32 20 88 20 34 0d 01 22 6e f2 62 6c 65 6e | 32 . 4.."n.blen| 000002a0 64 48 28 28 72 31 73 2a 70 29 2b 61 28 32 2c 30 |dH((r1s*p)+a(2,0| 000002b0 29 2c 67 31 73 2a 70 2b 61 28 32 2c 31 29 2c 62 |),g1s*p+a(2,1),b| 000002c0 31 73 2a 70 2b 61 28 32 2c 32 29 2c 72 32 73 2a |1s*p+a(2,2),r2s*| 000002d0 70 2b 61 28 33 2c 30 29 2c 67 32 73 2a 70 2b 61 |p+a(3,0),g2s*p+a| 000002e0 28 33 2c 31 29 2c 62 32 73 2a 32 2b 61 28 33 2c |(3,1),b2s*2+a(3,| 000002f0 32 29 2c 34 30 2c 34 30 2c 33 32 2d 70 2c 30 2c |2),40,40,32-p,0,| 00000300 33 32 2d 70 29 0d 01 2c 05 ed 0d 01 36 05 ed 0d |32-p)..,....6...| 00000310 01 40 05 ed 0d 01 4a 05 3a 0d 01 54 05 e0 0d 01 |.@....J.:..T....| 00000320 5e 05 3a 0d 01 68 2f dd f2 62 6c 65 6e 64 56 28 |^.:..h/..blendV(| 00000330 72 31 2c 67 31 2c 62 31 2c 72 32 2c 67 32 2c 62 |r1,g1,b1,r2,g2,b| 00000340 32 2c 6e 75 6d 2c 62 78 2c 62 79 2c 74 78 2c 74 |2,num,bx,by,tx,t| 00000350 79 29 0d 01 72 28 ea 20 73 74 65 70 2c 72 73 74 |y)..r(. step,rst| 00000360 65 70 2c 67 73 74 65 70 2c 62 73 74 65 70 2c 69 |ep,gstep,bstep,i| 00000370 2c 73 65 74 5f 67 63 6f 6c 25 0d 01 7c 42 c8 99 |,set_gcol%..|B..| 00000380 20 22 4f 53 5f 53 57 49 4e 75 6d 62 65 72 46 72 | "OS_SWINumberFr| 00000390 6f 6d 53 74 72 69 6e 67 22 2c 2c 22 43 6f 6c 6f |omString",,"Colo| 000003a0 75 72 54 72 61 6e 73 5f 53 65 74 47 43 4f 4c 22 |urTrans_SetGCOL"| 000003b0 20 b8 20 73 65 74 5f 67 63 6f 6c 25 0d 01 86 14 | . set_gcol%....| 000003c0 73 74 65 70 3d 28 74 79 2d 62 79 29 2f 6e 75 6d |step=(ty-by)/num| 000003d0 0d 01 90 15 72 73 74 65 70 3d 28 72 31 2d 72 32 |....rstep=(r1-r2| 000003e0 29 2f 6e 75 6d 0d 01 9a 15 67 73 74 65 70 3d 28 |)/num....gstep=(| 000003f0 67 31 2d 67 32 29 2f 6e 75 6d 0d 01 a4 15 62 73 |g1-g2)/num....bs| 00000400 74 65 70 3d 28 62 31 2d 62 32 29 2f 6e 75 6d 0d |tep=(b1-b2)/num.| 00000410 01 ae 0f e3 20 69 3d 30 20 b8 20 6e 75 6d 0d 01 |.... i=0 . num..| 00000420 b8 12 72 3d 28 72 73 74 65 70 2a 69 29 2b 72 32 |..r=(rstep*i)+r2| 00000430 0d 01 c2 12 67 3d 28 67 73 74 65 70 2a 69 29 2b |....g=(gstep*i)+| 00000440 67 32 0d 01 cc 12 62 3d 28 62 73 74 65 70 2a 69 |g2....b=(bstep*i| 00000450 29 2b 62 32 0d 01 d6 30 c8 99 20 73 65 74 5f 67 |)+b2...0.. set_g| 00000460 63 6f 6c 25 2c 28 72 3c 3c 38 29 2b 28 67 3c 3c |col%,(r<<8)+(g<<| 00000470 31 36 29 2b 28 62 3c 3c 32 34 29 2c 2c 2c 26 31 |16)+(b<<24),,,&1| 00000480 30 30 2c 30 0d 01 e0 23 c8 93 20 c8 90 20 62 78 |00,0...#.. .. bx| 00000490 2c 28 69 2a 73 74 65 70 29 2b 62 79 2c 74 78 2d |,(i*step)+by,tx-| 000004a0 62 78 2c 73 74 65 70 0d 01 ea 05 ed 0d 01 f4 05 |bx,step.........| 000004b0 e1 0d 01 fe 05 3a 0d 02 08 2f dd f2 62 6c 65 6e |.....:.../..blen| 000004c0 64 48 28 72 31 2c 67 31 2c 62 31 2c 72 32 2c 67 |dH(r1,g1,b1,r2,g| 000004d0 32 2c 62 32 2c 6e 75 6d 2c 62 78 2c 62 79 2c 74 |2,b2,num,bx,by,t| 000004e0 78 2c 74 79 29 0d 02 12 28 ea 20 73 74 65 70 2c |x,ty)...(. step,| 000004f0 72 73 74 65 70 2c 67 73 74 65 70 2c 62 73 74 65 |rstep,gstep,bste| 00000500 70 2c 69 2c 73 65 74 5f 67 63 6f 6c 25 0d 02 1c |p,i,set_gcol%...| 00000510 42 c8 99 20 22 4f 53 5f 53 57 49 4e 75 6d 62 65 |B.. "OS_SWINumbe| 00000520 72 46 72 6f 6d 53 74 72 69 6e 67 22 2c 2c 22 43 |rFromString",,"C| 00000530 6f 6c 6f 75 72 54 72 61 6e 73 5f 53 65 74 47 43 |olourTrans_SetGC| 00000540 4f 4c 22 20 b8 20 73 65 74 5f 67 63 6f 6c 25 0d |OL" . set_gcol%.| 00000550 02 26 14 73 74 65 70 3d 28 74 78 2d 62 78 29 2f |.&.step=(tx-bx)/| 00000560 6e 75 6d 0d 02 30 15 72 73 74 65 70 3d 28 72 31 |num..0.rstep=(r1| 00000570 2d 72 32 29 2f 6e 75 6d 0d 02 3a 15 67 73 74 65 |-r2)/num..:.gste| 00000580 70 3d 28 67 31 2d 67 32 29 2f 6e 75 6d 0d 02 44 |p=(g1-g2)/num..D| 00000590 15 62 73 74 65 70 3d 28 62 31 2d 62 32 29 2f 6e |.bstep=(b1-b2)/n| 000005a0 75 6d 0d 02 4e 0f e3 20 69 3d 30 20 b8 20 6e 75 |um..N.. i=0 . nu| 000005b0 6d 0d 02 58 12 72 3d 28 72 73 74 65 70 2a 69 29 |m..X.r=(rstep*i)| 000005c0 2b 72 32 0d 02 62 12 67 3d 28 67 73 74 65 70 2a |+r2..b.g=(gstep*| 000005d0 69 29 2b 67 32 0d 02 6c 12 62 3d 28 62 73 74 65 |i)+g2..l.b=(bste| 000005e0 70 2a 69 29 2b 62 32 0d 02 76 30 c8 99 20 73 65 |p*i)+b2..v0.. se| 000005f0 74 5f 67 63 6f 6c 25 2c 28 72 3c 3c 38 29 2b 28 |t_gcol%,(r<<8)+(| 00000600 67 3c 3c 31 36 29 2b 28 62 3c 3c 32 34 29 2c 2c |g<<16)+(b<<24),,| 00000610 2c 26 31 30 30 2c 30 0d 02 80 23 c8 93 20 c8 90 |,&100,0...#.. ..| 00000620 20 28 69 2a 73 74 65 70 29 2b 62 78 2c 62 79 2c | (i*step)+bx,by,| 00000630 73 74 65 70 2c 74 79 2d 62 79 0d 02 8a 05 ed 0d |step,ty-by......| 00000640 02 94 05 e1 0d ff |......| 00000646