Sierpinski triangle done with only circles, generalized to any regular polygon and then made to move with alpha detailing:

OK, copy / paste from forum ran fine for me after deleting blank first line.

Code:

`'Sierpinski circled.txt `

' written for Naalaa 6 by bplus 2018-07-21

' translated from Sierepinski Circled.bas by bplus 2018-04-04 QB64 v 11-06-2017

' A new twist on an old fractal.

' Sierpinski triangle generalized and made dynamic for any regular poly though does not work well beyond 8 or 9.

randomize time() + rnd(100)

radians

constant:

wW 700

wH 700

visible:

pi# = acos#(-1.0)

pi2# = 2.0 * pi#

pip5# = pi# * 0.5

pi360# = pi# / 360.0

cx# = float(wW / 2)

cy# = float(wH / 2)

cr# = float(wH) / 6.0

r#

g#

b#

levels

hidden:

set window 100, 20, wW, wH

set redraw false

for n = 3 to 8

'n = 3

a# = 0.0

r# = float(56 + rnd(200)); g# = float(56 + rnd(200)); b# = float#(56 + rnd(200))

levels = 12 - n

shade = 255

while a# <= pi2#

set color 0, 0, 0

draw rect 0, 0, wW, wH, true

_recurringCircles cx#, cy#, cr#, a#, n, levels

a# = a# + pi360#

redraw

wait 1

wend

_pause

next

procedure recurringCircles (x#, y#, rr#, ao#, n, level)

cf# = float(12 - level) / 12.0

'try this with alpha maybe 50 but kind of dark and blurry

'without alpha, too much overlap to show fine pattern detail

set color int(r#*cf#), int(g#*cf#), int(b#*cf#), 50

draw ellipse int(x), int(y), int(rr#), int(rr#), true

if level > 0

pi5# = pi# * 0.5

ra# = pi2# / float(n)

for i = 0 to n - 1

x1# = x# + 1.5 * rr# * cos#(float(i) * ra# + ao# - pip5#)

y1# = y# + 1.5 * rr# * sin#(float(i) * ra# + ao# - pip5#)

_recurringCircles x1#, y1#, rr# * 0.5, 2.0 * ao#, n, level - 1

next

endif

endproc

procedure pause()

set color 200, 225, 250

wln "Click mouse to continue..."

redraw

wait mousebutton

endproc

OK, copy / paste from forum ran fine for me after deleting blank first line.

b = b + geberation