English
Opportunities and suggestions

wish: "Infinite" Rekursion too for functions

 
since XProfan-without-border is it possible a sheer infinity Prozedurrekursion to Abarbeitung To moving.

unfortunately meets not on Own functions To, separate only on Procedures.

Hierbei is the spelling definitive.
CompileMarkSeparation
crashes in example very quick ex against which
CompileMarkSeparationinfinite (grenzenFrei How promised) worn out becomes.

I can present the Prf2CPP-User anyhow always a infinity procedure/Funktionsrekursion work out let can. @Sebastian: is the so?

Büdde improve Roland.

here another very anschauliches and simple Example for a Füll-function which The Rekursion uses as memory.
CompileMarkSeparation
CLS
USEPEN 0,0,0
RECTANGLE 1,1 - WIDTH(%HWND)-10,HEIGHT(%HWND)-10
LINE 10,10 - 200,20
LINE 200,20 - 50,300
LINE 50,300 - 100,50
LINE 100,50 - 10,10
ELLIPSE 300,200 - 500,400
F 120,100,GETPIXEL(120,100)
F 400,300,GETPIXEL(300,200)
PRINT bingo
WAITINPUT

proc F

    PARAMETERS X&,Y&,TOFILL&
    SETPIXEL X&,Y&,0

    IF GETPIXEL(X&+1,Y&)=TOFILL&

        F X&+1,Y&,TOFILL&

    ENDIF

    IF GETPIXEL(X&,Y&+1)=TOFILL&

        F X&,Y&+1,TOFILL&

    ENDIF

    IF GETPIXEL(X&-1,Y&)=TOFILL&

        F X&-1,Y&,TOFILL&

    ENDIF

    IF GETPIXEL(X&,Y&-1)=TOFILL&

        F X&,Y&-1,TOFILL&

    ENDIF

endproc


976 kB
Hochgeladen:02/13/08
Downloadcounter148
Download
 
02/13/08  
 




Sebastian
König
iF

I can present the Prf2CPP-User anyhow always a infinity procedure/Funktionsrekursion work out let can. @Sebastian: is the so?

No, unfortunately not - The Aufruftiefe is momentarily on 32 terminable. the has with the memory-management for Paramter-Stack To do...

MfG

Sebastian
 
Windows XP, XProfan/Profan² 4.5 bis 11
Profan2Cpp-Homepage:  [...] 
Alte Profan²-Seite:  [...] 
02/13/08  
 



i see - and it's a great pity.

to 32: allowing there Roland not a explicit höhere Recursion?
 
02/13/08  
 




Sebastian
König
iF
i see - and it's a great pity.

to 32: allowing there Roland not a explicit höhere Recursion?


there be I me now not sure... I thought, I had me with the number on XProfan orientiert...

The Einschränkung there incidentally yet not at all such a long time, separate first since I fixes have, that it for Parameter-Stack a Difference power, whether a procedure as commands or as function called becomes. in the Context yet the Info, that The boundary only for Function-Variante counts - as commands is the allowing deep objectively infinite. EDIT: means very How in XProfan, How I straight see - my Nachbau is evident really well...

MfG

Sebastian
 
Windows XP, XProfan/Profan² 4.5 bis 11
Profan2Cpp-Homepage:  [...] 
Alte Profan²-Seite:  [...] 
02/13/08  
 



this Testcode gives a gewisse operator: (under The exe)
CompileMarkSeparation
//Version:0.0.3
 {$cleq}
randomize
long i
cls
usepen 0,0,0
rectangle 1,1 - width(hwnd)-10,height(hwnd)-10
line 10,10 - 200,20
line 200,20 - 50,300
line 50,300 - 100,50
line 100,50 - 10,10
ellipse 300,200 - 500,400
f 400,300,getpixel(400,300)
f 120,100,getpixel(120,100)
f 400,300,getpixel(300,200)
print bingo
waitinput
end

f(long x,y,tofill){

    i+
    locate 1,20
    print i
    setpixel x,y,0
    case getpixel(x+1,y)==tofill : f(x+1,y,tofill)
    case getpixel(x,y+1)==tofill : f(x,y+1,tofill)
    case getpixel(x-1,y)==tofill : f(x-1,y,tofill)
    case getpixel(x,y-1)==tofill : f(x,y-1,tofill)
    i-nt color=#0000FF>}


EDIT: code and EXE revised, it fehlte i- end the function f.

with the new code becomes me max 4.380 for i displayed.

977 kB
Hochgeladen:02/13/08
Downloadcounter155
Download
 
02/13/08  
 




Sebastian
König
OK, The number can I confirm. objectively find I in the XProfan-Help indicated for maximum appeal-Verschachtelung, The 32 have I means well self chosen... shone me somehow one integrally guter Kompromiss between performance and memory-consumption To his. technical would it no too large trouble, The boundary abzuschaffen - I must only time look, whether and How very The speed under suffering would...

MfG

Sebastian
 
Windows XP, XProfan/Profan² 4.5 bis 11
Profan2Cpp-Homepage:  [...] 
Alte Profan²-Seite:  [...] 
02/13/08  
 




Sebastian
König
another Nachtrag...

at that viewing of my own Codes see I straight, that The allowing deep in the principle  in Profan2Cpp still infinite is. ex the 33. plain behave itself the Stack with one appeal as function though then just as How with one appeal as commands. should hot: the go wrong Stack becomes then moreover using....
 
Windows XP, XProfan/Profan² 4.5 bis 11
Profan2Cpp-Homepage:  [...] 
Alte Profan²-Seite:  [...] 
02/13/08  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

4.246 Views

Untitledvor 0 min.
Jörg Sellmeyer05/12/18

Themeninformationen

this Topic has 2 subscriber:

Sebastian König (4x)
iF (3x)


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