Hi out there It is now maybe two years since I started scanning old QL magazines, sometimes there is really amazing information but until today I never found a more amazing piece of code than the following one - both how it is done technically (recursion) and the graphical effect. I really wonder if A. Pritchard is still around in the QL scene - the idea to draw a tree recursively just knocks me out - why doesn't the ole man from heaven give me the inspiration to invent such great things :-(
The reason for this posting: I really wonder if someone out there also has something special: a stunning effect from some simple (at the first) SuperBasic code? Regards! Michael 100 REMark *** QL USER 1985 *** 110 REMark *** Tree by A. Pritchard *** 120 PAPER 5:PAPER#2,5:WINDOW 512,256,0,0 125 WINDOW#2,512,256,0,0:MODE 8 130 INK 7:FILL 1:CIRCLE 80,60,10:FILL 0:INK#2,0 140 FOR i=1 TO 10:CIRCLE 80,2,i,.1,PI/2:NEXT i 150 FOR h=25 TO 12 STEP -1:d:NEXT h:INK 0:FILL 1 160 LINE 0,-3 TO 28,40 TO 36,40:ARC TO 50,-3,PI/2 170 FILL 0:tr 28,40,20,8:INK 3:AT 0,5:OVER 1 180 CSIZE 3,1:PRINT '"Shivering in the Wind"'; 190 CSIZE 2,0:PRINT "AP85"; 195 : 200 DEFine PROCedure tr(x,y,l,b) 205 LOCal i,f,g,b1 210 IF l<2 THEN RETurn 220 FOR i=1 TO 4 230 b1=b/2:IF b/2 >1 THEN FILL 1 240 f=x+(i*l-1.2*l-RND(1))*1.2:g=y+RND(l*2.3)-1/3 250 k=0:IF i=4 AND l=20 THEN k=3 260 LINE x,y TO f,g TO f+b1-1,g 270 LINE TO x+b-1,y-k TO x,y 280 FILL 0:tr f,g,l/2,b/2:NEXT i 285 END DEFine 287 : 290 DEFine PROCedure d 295 p=RND(150)-30:g=RND(160) 300 INK 3:FILL 1:LINE p,10 TO (p+g)/2,h TO g,10 310 FILL 0:INK 7:LINE (p+g)/2,h TO g,10:INK 3,5 320 FILL 1:LINE p,10 TO (p+g)/2,10-(h-10)/3 TO g,10 330 FILL 0 340 END DEFine _______________________________________________ QL-Users Mailing List http://www.quanta.org.uk/mailing.htm
