declare s1% , s2% , res%
whileloop 0 , 10
s1% = &loop
whileloop 0 , 10
s2% = &loop
res% = AND(s1%,s2%)
Oder eben
res% = OR(s1%,s2%)
Oder auch
res% = ADD(s1%,s2%)
EndWhile
CompileMarkSeparation
the was already anschaulicher, but by far just as unnütz as numbers (very taken was whole experiment unnütz ).
anyway drove I away, in the I the Zahlenbereich on 0-100 ausweiterte.
and suddenly came me The figures, The AND and OR hervorbrachten right famous to...
After something Herumprobieren chose I the Zahlenbereich 0-127 and finally having it by me Click made.
it dealt itself for a [...] !
These Figur becomes usually only through Rekursion access (first letztes year be I on the draw this Figur through Rekursion kläglich failed).
Umso More i was surprised, that itself these Figur over binäre Verknüpfungs-functions achieve let.
After some work got I subesquent bildschönen code out:
CompileMarkSeparation
proc DrawSierpinskiAND
parameters ord% , colour% , x% , y%
declare i%
ord% = 2 ^ ord%
whileloop 0 , ord%-1
i% = &loop
whileloop 0 , i%
SetPixel x%+i% , y%+And(i%,&loop) , colour%
EndWhile
EndWhile
endproc
proc DrawSierpinskiOR
parameters ord% , colour% , x% , y%
declare i%
ord% = 2 ^ ord%
whileloop 0 , ord%-1
i% = &loop
whileloop 0 , ord%-1-i%
SetPixel x%+i% , y%+Or(i%,&loop) , colour%
EndWhile
EndWhile
endproc
declare time&
cls
Text Color RGB(255,255,255) , (-1)
UseBrush 1 , RGB(000,000,000)
Fill 10 , 10 , 0
UseBrush 1 , RGB(255,255,255)
Rectangle 99 , 99 - 101+256 , 101+256
time& = &GetTickCount
DrawSierpinskiAND 8 , RGB(255,000,000) , 100+000 , 100+000
DrawText 10 , 10 , st$(int((&GetTickCount-time&)1000))
waitinput
Rectangle 99 , 99 - 101+256 , 101+256
time& = &GetTickCount
DrawSierpinskiAND 7 , RGB(255,000,000) , 100+000 , 100+000
DrawSierpinskiAND 7 , RGB(255,000,000) , 100+128 , 100+000
DrawSierpinskiAND 7 , RGB(255,000,000) , 100+128 , 100+128
DrawText 10 , 30 , st$(int((&GetTickCount-time&)1000))
waitinput
Rectangle 99 , 99 - 101+256 , 101+256
time& = &GetTickCount
DrawSierpinskiAND 6 , RGB(255,000,000) , 100+000 , 100+000
DrawSierpinskiAND 6 , RGB(255,000,000) , 100+064 , 100+000
DrawSierpinskiAND 6 , RGB(255,000,000) , 100+064 , 100+064
DrawSierpinskiAND 6 , RGB(255,000,000) , 100+128 , 100+000
DrawSierpinskiAND 6 , RGB(255,000,000) , 100+192 , 100+000
DrawSierpinskiAND 6 , RGB(255,000,000) , 100+192 , 100+064
DrawSierpinskiAND 6 , RGB(255,000,000) , 100+128 , 100+128
DrawSierpinskiAND 6 , RGB(255,000,000) , 100+192 , 100+128
DrawSierpinskiAND 6 , RGB(255,000,000) , 100+192 , 100+192
DrawText 10 , 50 , st$(int((&GetTickCount-time&)1000))
waitinput
end
Parameter:
ord% = Ordung the Dreiecks (apiece higher, umso larger becomes it)
colour% = colour the Dreieckes as RGB-worth
x% , y% = X- and Y-position the Dreieckes
of these code can itself quick find out, that itself such a triangle faster draw can, if one it in smaller ones Teildreiecke zerlegt.
hope, the has somebody interested.