Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!lll-tis!ames!pasteur!ucbvax!RITVAX.BITNET!LMB7421 From: LMB7421@RITVAX.BITNET Newsgroups: comp.sys.apple Subject: A VERY slow Mandelbrot generator (in BASIC) Message-ID: <8803170230.aa09158@SMOKE.BRL.ARPA> Date: 17 Mar 88 03:35:00 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 74 Below is a BASIC program which will compute at least some of the Mandelbrot Set. It requires an Ampersand utility from Nibble which plots on the Super-Res screen. If you have a similar utility, modify lines 25 and 110 according to your specific utility. PN is Rmin PX is Rmax QN is Imin QX is Imax M is the Mandelbrot limit (set this higher for high magnification if necessary) CS is the maximum number of colors - 1 MC is the maximum simulated number of non - 0 colors. If MC is greater than CS, the non-0 colors are repeated as K MOD CS + 1 K is the current simulated color. If K = MC, then the point is considered to be a member of the set, and is assigned color 0 (black) You can set the palette as you choose, using the palette changer in the ampersand utility. I used a scheme where color 0 = black, and colors 1 - 15 had blue = 10, and red and green = ColorNumber, which gives a range from dark blue through yellow. Once the picture is done (this will take at least 14 hours, unless you've chosen a range that's very large or far away from the set), you can save the picture by typing the following (type carefully, as you won't have a visible command line until after the C029:41) CALL - 151 C029:41 00/1000 M THEN CL = K - INT(K / CS) * CS + 1 : GOTO 110 90 IF K = MC THEN CL = 0 : GOTO 110 100 GOTO 60 110 & HCOLOR= CL : & HPLOT X , Y : NEXT X : NEXT Y 10000 REM _______________________________________________ 10010 REM | | 10020 REM | Mandelbrot Set grapher | 10030 REM | by | 10040 REM | Les Barstow | 10050 REM | LMB7421@RITVAX.BITNET | 10060 REM | rutgers!rochester!ritcv!ultb!lmb7421 | 10070 REM | 292 Kimball Dr. Rochester, NY 14623 | 10080 REM | | 10090 REM +---------------------------------------------+ 10100 REM ***Freeware. Distribute, don't sell.