Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Schraf Brot Fractal
#1
Cute fractal converted from QB64pe...  Takes about 15 secs before it displays...

Code:
' QB64pe user, Aurel, posted this in June 2025
'
set window "Schraf Brot Fractal", 1280, 700, false
set redraw off

set color 0, 0, 0
cls

randomize clock()

w = width(primary)
h = height(primary)
zoom = 4 / w
dmin = 0.06

for a = 0 to w - 1
    for b = 0 to 1.5 * h
        x = (a - w) * zoom
        y = (b - h) * zoom
        i = 0
        d = 100
        do
            u= x * x
            v = y * y
            if u + v > 4.8 or i > 30 or d < dmin then
                break
            endif
            t = u - v
            y = 2 * x * y + 0.156
            x = t - 0.8
            i = i + 1
            n = abs(u + v - 1)
            if n < d then
                d = n
            endif
        loop
        if d < dmin then
            colour = 255 - int(4000 * d)
            if colour < 0 then
                colour = 255
            endif
            x1 = a - w / 2
            y1 = b - h / 2
            x2 = w + w / 2 - 1 - a
            y2 = h + h / 2 - b
            set color 0, colour, colour
            draw line x1, y1, x1 + 1, y1 + 1
            draw line x2, y2, x2 + 1, y2 + 1
        endif
    next
    'wait(5)
    redraw
    fwait 60
next

wait 3000

The original colour was - set color colour, colour, 0 - yellow

For an "instant" display, place the redraw just before the wait....
Logic is the beginning of wisdom.
Reply
#2
   
click the image to zoom in

Code:
wait 3000

Instead of using a 3000 wait delay to pause, I prefer using the Escape key so I can stare at the magical fractal for hours — it's truly amazing and beautifully crafted. Hats off to the brilliant developer who made this masterpiece !

Code:
'pause
do
    set color 255,255,255
    set caret 10,10
    wln "Press ESC to exit"
    redraw
    wait 1
until keydown(KEY_ESCAPE,true)
Reply
#3
Masterpiece? Agreed! Big Grin
Logic is the beginning of wisdom.
Reply
#4
Never seen that one before!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)