Qbasicnews.com

QBasic => QB Projects => Topic started by: Antoni Gual on June 19, 2003, 05:49:04 PM



Title: Buddahbrot fractal
Post by: Antoni Gual 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.


Title: Buddahbrot fractal
Post by: Ninkazu on June 19, 2003, 06:59:44 PM
Ya, I did that for my math project ;)


Title: Buddahbrot fractal
Post by: toonski84 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! :)


Title: Buddahbrot fractal
Post by: oracle 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...


Title: Buddahbrot fractal
Post by: Antoni Gual 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.:P

So you probably patiented too much...  : :D


Title: Buddahbrot fractal
Post by: oracle 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:


Title: Congratulation, Antoni !
Post by: Jark 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!


Title: Buddahbrot fractal
Post by: Antoni Gual 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...


Title: It's horrible !
Post by: Jark 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...


Title: Buddahbrot fractal
Post by: na_th_an 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?


Title: Buddahbrot fractal
Post by: Piptol 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 :P
http://www.urbanlegends.com/ulz/bonsai.html


Title: Buddahbrot fractal
Post by: red_Marvin on July 20, 2003, 12:27:14 PM
Yes, AFAIK it's just an urban legend...


Title: Buddahbrot fractal
Post by: toonski84 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.


Title: Buddahbrot fractal
Post by: na_th_an 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...


Title: Buddahbrot fractal
Post by: Antoni Gual 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...


Title: Buddahbrot fractal
Post by: na_th_an on July 21, 2003, 09:27:28 AM
.. And that's a shame. Bullfights should be completely forbidden.

It is a big shame for me that my country is know worldwide for such an atrocity.


Title: Corrida
Post by: Jark on July 21, 2003, 10:05:08 AM
It's a great joy to see that bullfight is considered as a shame by some of you!

I love this song by Francis Cabrel about this subject, especially the "ridiculous dancer" image, and the "have fun around a tumb" verse:

"Depuis le temps que je patiente
Dans cette chambre noire
J'entends qu'on s'amuse et qu'on chante
Au bout du couloir ;
Quelqu'un a touché le verrou
Et j'ai plongé vers le grand jour
J'ai vu les fanfares, les barrières
Et les gens autour

Dans les premiers moments j'ai cru
Qu'il fallait seulement se défendre
Mais cette place est sans issue
Je commence à comprendre
Ils ont refermé derrière moi
Ils ont eu peur que je recule
Je vais bien finir par l'avoir
Cette danseuse ridicule...

Est-ce que ce monde est sérieux ?
Est-ce que ce monde est sérieux ?
Andalousie je me souviens
Les prairies bordées de cactus
Je ne vais pas trembler devant
Ce pantin, ce minus !
Je vais l'attraper, lui et son chapeau
Les faire tourner comme un soleil

Ce soir la femme du torero
Dormira sur ses deux oreilles
Est-ce que ce monde est sérieux ?
Est-ce que ce monde est sérieux ?
J'en ai poursuivi des fantômes
Presque touché leurs ballerines
Ils ont frappé fort dans mon cou
Pour que je m'incline

Ils sortent d'où ces acrobates
Avec leurs costumes de papier ?
J'ai jamais appris à me battre
Contre des poupées
Sentir le sable sous ma tête
C'est fou comme ça peut faire du bien
J'ai prié pour que s'arrête
Andalousie je me souviens

Je les entends rire comme je râle
Je les vois danser comme je succombe
Je pensais pas qu'on puisse autant
S'amuser autour d'une tombe
Est-ce que ce monde est sérieux ?
Est-ce que ce monde est sérieux ?
Si, si hombre, hombre
Baila, baila

Hay que bailar de nuevo
Y mataremos otros
Otras vidas, otros toros
Y mataremos otros
Venga, venga a bailar...
Y mataremos otros"


Title: Bonsai...
Post by: Jark on July 21, 2003, 10:09:07 AM
will be, maybe, unlegal too. Who knows ?

Did you hear about that tree in South Africa that develops a collective defense system against antilops ? So strange...


Title: Re: Buddahbrot fractal
Post by: Bennedictedu75 on May 04, 2011, 04:45:42 AM
Hello,
By the way, this song is the one i like the most. And bit surprised to see somebody here knows this singer. The words are lovely.
Bennedicte