English
Regulars table & Café

on the Spuren the Herrn Sierpinski

 

Nico
Madysa
last saturday evening (I had me decided, Asterix still not To bad ) have I a little bit with binärem OR and AND engage.
i was walking of einfachen drop from, I the numbers of 0 To 10 in all possible Kombinationen together verknüpfe.
CompileMarkSeparation
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
SetPixel s1% , res% , RGB(255,0,0)

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.
 
Nico Madysa
07/17/06  
 




Jac
de
Lad
You can Yes your Profan-code yet To Wikipedia dazuschreiben. but i'm in the momentum yet unclear wozu to the need, means a virtually application missing somehow...

Jac

PS: on the saturday i was time again with of my girl-friend in Döbeln (since 6 weeks time again) and Asterix Have I on the sunday geschaut (kid was abgeschoben, Asterix can always!).
 
Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE)
Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP
07/17/06  
 




Nico
Madysa
I see there too none sense (except I my Info-teacher beeindrucken can ). i was solely of it beeindruckt, that itself something like without Rekursion produce can and I me on the evening like a Schneekönig gefreut.
 
Nico Madysa
07/19/06  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

1.495 Views

Untitledvor 0 min.
Peter Max Müller05/13/15

Themeninformationen

this Topic has 2 subscriber:

Nico Madysa (2x)
Jac de Lad (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie