Authors
Publication
Publication Details
Volume: 3 Issue: 7
Date
Pages

The August issue of the Scientific American has on its cover a computer-generated display. I tried the scheme on my 2068. The resolution is much poorer, but the results are quite fascinating. The program shows how I set up the algorithm. Not having a color monitor, I plotted shades of gray that are obtained by use of user-defined graphics. The routine starting at line 200 is run once at the beginning to set up the graphics.
The shades of gray obtained for different values are shown here. The algorithm evaluates the expression “z*z+c” where z and c are complex numbers. If the “size” of z is less than 2 then the procedure is iterated. After 100 iterations z is said to converge if its size is still <2. If z becomes > 2 at an iteration (n) which is less than the value of n, n is used to choose a level of gray. The smaller the value of n, the lighter the shade of gray. Line 140 shows that white is chosen for n<20. If you have a color monitor, you can eliminate the subroutine starting at line 200 and change line 142 to:
PRINT INK a; AT x,y; “■“
The program creates a display by testing for convergence for a different value of c at each screen location. A starting value of the real and imaginary parts of c, rcz and icz, is entered on lines 20 and 30. For each screen position the values of rc and ic are incremented on lines 46 and 48. The size of the increment determines the detail in the image. I have chosen to cover the range that adds .001 to the starting values in generating my image. You can try more or less. I have chosen rcz=.26 and icz=0 as my starting values. You should read the original article to get ideas for different starting values.
You can get a factor of 8 improvement in the resolution by using the PLOT function. This should be tried only if you have a color monitor and lots of time. It takes about 2 hours to generate one of the images with the present resolution of 20 x 30, so it would take about 5 days to do an image of 160 x 240.
1 rem Mandelbrot set in low resolution by Roald Schack\n2 rem https://archive.org/details/cats-newsletter/CATS%20v3%20n7%20Oct%201985/page/11/mode/1up\n10 print "Give real or imaginary parts of c"\n15 go sub 200\n20 input rcz\n30 input icz\n32 cls\n40 for x=1 to 20\n43 for y=1 to 30\n44 let n=1\n46 let rc=rcz+.000033*y\n48 let ic=icz+.00005*x\n50 let iz=0\n60 let rz=0\n70 let rz=rz*rz-iz*iz+rc\n80 let iz=2*rz*iz+ic\n86 let n=n+1\n90 let size=sqr (rz*rz+iz*iz)\n100 if (size>=2) then go to 140\n110 if (n<=99) then go to 70\n120 print at x,y;"\::"\n130 go to 150\n140 let a=int ((n-20)/10)\n142 print at x,y; chr$ (145+a)\n152 next y\n170 next x\n190 stop\n200 for m=0 to 8\n205 let w=145+m\n210 for p=0 to 7\n220 read byte\n230 poke usr chr$ w+p,byte\n240 next p\n260 next m\n270 data 0,0,0,0,0,0,0,0\n280 data 0,0,0,8,0,0,0,0\n290 data 0,0,32,0,0,0,2,0\n300 data 0,64,4,0,0,32,2,0\n310 data 8,64,2,16,128,4,32,1\n320 data 0,85,0,85,0,85,0,85\n330 data 170,85,170,85,170,85,170,85\n340 data 187,221,238,119,187,221,238,119\n350 data 255,255,255,255,255,255,255,255\n360 return