ok so i made a litle program that generates koch snowflakes ( iterations ) using strings
sync on : sync rate 60 : a2setlineaa 0
t = 0
global dim state(500)
rem +90,-45 = 8
rem +120,-60 = 6
rem +144,-72 = 5
koch$ = "RRR"
for ii = 1 to t
l = len(koch$)
k$ = ""
for i = 1 to l
temp$ = koch(mid$(koch$,i))
k$ = k$+temp$
NEXT
koch$ = k$
next
s# = 400
do
x# = mousex() : y# = mousey() : z# = 0
a2startlinebatch 3*4^t : for i = 1 to 3*4^(t)
tt = kval(koch$,i)
if tt = 2 then z# = z#+120
if tt = 1 then z# = z#-60
ox# = x# : oy# = y# : x# = newxvalue(x#,z#,s#) : y# = newzvalue(y#,z#,s#) : a2line ox#,oy#,x#,y#,rgb(tt*255-255,510-tt*255,0)
NEXT : a2endbatch
print "iteration : "+str$(t)
sync : cls
if keypress(200) = 2 then inc t : s# = s#/3 : c = 1
if keypress(208) = 2 then dec t : s# = s#*3 : c = 1
if leftkey() then s# = s#*1.5
if rightkey() then s# = s#/1.5
if c = 1 : c = 0
koch$ = "RRR"
for ii = 1 to t
l = len(koch$) : k$ = ""
for i = 1 to l
temp$ = koch(mid$(koch$,i))
k$ = k$+temp$
NEXT
koch$ = k$
next
ENDIF
LOOP
function kval(s$,i)
if mid$(s$,i) = "L" then v = 1 else v = 2
endfunction v
function koch(s$)
s$ = s$+"LRL"
ENDFUNCTION s$
function keypress(key)
if keystate(key) = 1
accept = 1
if state(key) = 0
accept = 2
state(key) = 1
endif
ENDIF
if keystate(key) = 0 then state(key) = 0
ENDFUNCTION accept
it requires the advanced 2d plugin, but you can easily change the
commands "a2startlinebatch", "a2line" and "a2endbatch" to something else it doesnt affect the snowflake only the visual part.
my computer can somewhat quickly generate the first 7 iterations, after that its very slow.
but it doesnt matter asafter 7 they all look the same at this level of zoom
USE UP/DOWN keys to iterate