Don't click here unless you want to be banned.

LSL Wiki : IconSerpentine

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl338.us.archive.org
Q: Recursion no work:
This is probably an intentional design decision, but I've recently discovered a situation where I would've liked to have used breadth-first recursion to solve a problem and realized that LSL doesn't seem to support it. Just a warning that a function calling itself within a turing machine doesn't work in LSL. The compiler doesn't even catch it so you won't get an error report if you try it.
recursive( integer int ) {
    if( int > 0 && !(int = 0) ) {
        int--;
        llSay(0, "Called recursive( "+(string)int+" )!";
        recursive( int );
    }
}
Will not produce an error message, but won't work either.



A:
Thats because that code is flawed. You mixed up your == and =
Why were you even checking for zero?
Anyway you should have a look at the Operators page
Try this:


recursive( integer int ) {
    if( int > 0 ) {
        --int;
        llSay(0, "Called recursive( "+(string)int+" )!";
        recursive( int );
    }
}
There is one comment on this page. [Display comments/form]