Qbasicnews.com
November 28, 2021, 12:23:49 AM
 Pages: [1] 2
 Author Topic: Buddahbrot fractal  (Read 15235 times)
Antoni Gual
Na_th_an

Posts: 1434

 « on: June 19, 2003, 05:49:04 PM »

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

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

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.
 Logged

Antoni
Ninkazu
Been there, done that

Posts: 1169

 « Reply #1 on: June 19, 2003, 06:59:44 PM »

Ya, I did that for my math project
 Logged

am an asshole. Get used to it.
toonski84
__/--\__

Posts: 2567

 « Reply #2 on: June 19, 2003, 11:58:19 PM »

Cool *gets a cup of coffee* *waits* *finishes cup* *goes to work* *comes back*

hey, it's done!
 Logged

i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
oracle
*/-\*

Posts: 3652

 « Reply #3 on: June 21, 2003, 01:34:10 AM »

How long does it take? I left it for ages (until 9500 in top left). It was turning into a blob...
 Logged

Antoni Gual
Na_th_an

Posts: 1434

 « Reply #4 on: June 21, 2003, 05:46:38 AM »

If i compile it with ffix, i get a correct image in 5 minutes. In the IDE and not compiled it should take 30 minutes. The counter is in seconds.

The program does'nt have a stop condition and keeps increasing the color number of the pixels untill they are all at color 255.

So you probably patiented too much...  :
 Logged

Antoni
oracle
*/-\*

Posts: 3652

 « Reply #5 on: June 21, 2003, 08:12:46 PM »

Aah.

Also, I have a cold, so had brightness down to 0 and contrast to 50, so it emerged as a blob.  :roll:
 Logged

Jark
Ancient Guru

Posts: 566

 « Reply #6 on: July 15, 2003, 05:50:05 PM »

You're now part of the very small club of the Buddhabrot makers :lol:

You may send your code to Melinda, I think you made the only fast program for a Buddhabrot: it can take several days to get a hi-res pic !

The funny thing when I made my first Buddhabrot is that Melinda (who was still a man then, she was named Daniel until last summer) and Lori were the only two who knew this trick... I decided I would try, and managed to understand the mysterious explanation on her webpage.

Then a polish guy asked on sci.fractals if someone knew the algorithm... I was just finishing my first prog! I posted the code on my site, and that's when it all started... Paul Bourke himself issued Buddhabrots, and I've been lucky enough to get my name in the Encyclopedia of the Mandelbrot set by Robert Munafo.

And that funny story proved one thing : if you want anybody to understand an algorithm, the best language to code it is Quick-Basic!
 Logged

hink Global, Make Symp' All ! ®
Antoni Gual
Na_th_an

Posts: 1434

 « Reply #7 on: July 18, 2003, 07:50:45 AM »

I was thinking Melissa would be a nice person until i saw she has he page of the Bonsai Kitten as one of her bookmarks.  :barf:

So i prefer not to have any relation with her...
 Logged

Antoni
Jark
Ancient Guru

Posts: 566

 « Reply #8 on: July 18, 2003, 09:40:47 AM »

The problem being it is not a joke !

Well, I managed to find the old Daniel Green page (it's not linked from the main site any longer, but Google still knows it).

It's quite funny to compare the "before" (Daniel) and after "Melinda" pictures...
 Logged

hink Global, Make Symp' All ! ®
na_th_an
*/-\*

Posts: 8244

 « Reply #9 on: July 18, 2003, 03:00:07 PM »

Quote from: "Antoni Gual"
I was thinking Melissa would be a nice person until i saw she has he page of the Bonsai Kitten as one of her bookmarks.  :barf:

So i prefer not to have any relation with her...

Oh my god I didn't know what it was so I visited the Bonsai Kitten page... This is one of the most horrible things I can think of! How can people be that evil? Sincerely I'm very impressed. That should be punished with jail. Is that legal?
 Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Piptol
Ancient QBer

Posts: 422

 « Reply #10 on: July 18, 2003, 04:28:52 PM »

I first saw that bonsai kitten thing a few years ago and assumed it was a joke. Looks like I was right
http://www.urbanlegends.com/ulz/bonsai.html
 Logged

In a world without walls and doors, who needs Windows and Gates?
red_Marvin
Na_th_an

Posts: 1509

 « Reply #11 on: July 20, 2003, 12:27:14 PM »

Yes, AFAIK it's just an urban legend...
 Logged

/post]
toonski84
__/--\__

Posts: 2567

 « Reply #12 on: July 20, 2003, 12:36:38 PM »

lol - of course it's a big joke.  'bonsai' specifically refers to trees.  the idea of stuffing kittens into jars is by far rediculous enough to be proof of a joke on its own.
 Logged

i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
na_th_an
*/-\*

Posts: 8244

 « Reply #13 on: July 20, 2003, 06:45:58 PM »

Not a joke for me, 'cause it is supposed that jokes should be funny.

Anyhow, I've seen more terrible things that were real, so...
 Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Antoni Gual
Na_th_an

Posts: 1434

 « Reply #14 on: July 21, 2003, 08:11:47 AM »

Quote
lol - of course it's a big joke. 'bonsai' specifically refers to trees. the idea of stuffing kittens into jars is by far rediculous enough to be proof of a joke on its own.

The idea is ridiculous. But the page gives too many details to be a hoax. There is people enjoying keping an agonizing cat into a jar for as long as possible.

Quote
That should be punished with jail. Is that legal?

In Spain it was not punishable until last month, where they approved a law against cruelty on animals. But Bullfight is still legal...
 Logged

Antoni
 Pages: [1] 2