11-03-2025, 10:16 PM
Code:
set window "Scharf Brot Fractal", 1280, 700, false
set redraw off
randomize clock()
w = width(primary)
h = height(primary)
zoom = 4 / w ' 4 / w ' if too wide
dmin = 0.06
set color 0, 0, 32
cls
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 ' original (colour, colour, 0) - yellow
draw line x1, y1, x1 + 1, y1 + 1
draw line x2, y2, x2 + 1, y2 + 1
endif
next
redraw
fwait 60
next
set color 255, 255, 255
set caret 100, 100
wln "ESQ to quit..."
redraw
do
fwait 60
until keydown(KEY_ESCAPE, true)
for fade = 0 to 255
set color 0, 0, 32, fade
draw rect 0, 0, width(primary), height(primary), true
redraw
fwait 60
nextBe patient... Takes about 15 seconds (or so) to display...
Modify the color to your liking (line #44?)
This is NOT my program... (not 'that' clever... lol) It is a program that was referred to myself that was found on the QB64pe forum. Figured I would modify for N7.
The ESC key and fade routines were just 'thrown' together. They work, but I feel that it could be done better...
Fractals are brilliant! Another method to "paint by numbers"...
Enjoy!
Logic is the beginning of wisdom.

