06-20-2003, 01:49 AM
It's in Jark's page but his QB program is in hi-res and takes ages to run. So I made a lo-res screen 13 version.
If you use ffix you will have a decent image in ten minutes.
It's just a differnet view of the Mandelbrot fractal. Melissa Green found it . http://www.superliminal.com/fractals/bbrot/bbrot.htm
If you liked it go to Jark's page, find the hi-res program and wait all night for a real good image in a bmp file.
If you use ffix you will have a decent image in ten minutes.
It's just a differnet view of the Mandelbrot fractal. Melissa Green found it . http://www.superliminal.com/fractals/bbrot/bbrot.htm
Code:
'Buddahbrot fractal by Antoni Gual
'If you are using ffix, uncomment the next two lines to boost speed x 5
'DECLARE SUB ffix
'ffix
SCREEN 13
RANDOMIZE TIMER
OUT &H3C8, 0
FOR i% = 0 TO 255
OUT &H3C9, 0
OUT &H3C9, i% \ 4
OUT &H3C9, 0
NEXT
COLOR 255
CONST niter = 10000
REDIM real(niter)
REDIM imag(niter)
t! = TIMER
DO
x = 4 * RND - 2
y = 4 * RND - 2
diverts% = 0
im = 0: re = 0: re2 = 0: im2 = 0
FOR iter% = 0 TO niter
im = 2 * re * im + x
re = re2 - im2 + y
real(iter%) = re
imag(iter%) = im
im2 = im * im
re2 = re * re
IF re2 + im2 > 4 THEN diverts% = 1: EXIT FOR
NEXT
'plot the points of the diverting values
IF diverts% THEN
FOR it% = 0 TO iter%
xx% = CINT(ABS(imag(it%) * 97))
xs% = xx% + 160
ys% = CINT(real(it%) * 97) + 150
pp% = POINT(xs%, ys%)
IF pp% < 255 AND pp% > -1 THEN PSET (xs%, ys%), pp% + 1: PSET (160 - xx%, ys%), pp% + 1
NEXT
np% = (np% + 1) AND &HFF
IF np% = 0 THEN LOCATE , 1: PRINT USING "####.#"; TIMER - t!;
END IF
LOOP UNTIL LEN(INKEY$)
END