Example: AutoPlay Media Studio 5.0 & Recursion

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Desmond
    Indigo Rose Staff Member
    • Jul 2003
    • 710

    Example: AutoPlay Media Studio 5.0 & Recursion

    This example shows the power of AutoPlay Media Studio with a well known recursive-function (calculating a fibonacci sequence).

    'Plop' the code below into any event on your project, and watch it fly! (Just don't use a number too high).

    Code:
    function fibonacci (nNumber)
    	if nNumber <= 2 then
    		return 1;
    	else
    		return fibonacci(nNumber-1) + fibonacci(nNumber-2);
    	end
    end
    
    
    input_number = String.ToNumber(Dialog.Input("Fibonacci Input", "Please enter the fibonacci number you want", "", MB_ICONQUESTION));
    
    
    Dialog.Message("", fibonacci(input_number));
    This is just a simple example, but with recursion in the mix, the possibilities for new and exciting projects just increased exponentially!
  • Corey
    Indigo Rose Staff Alumni
    • Aug 2002
    • 9745

    #2
    I grabbed a carbonara down at Fibonacci's the other night, it was great but the bill was like 2 to the power of 4 times 3 squared so I didn't know what to tip. I ended up just giving them my wallet. :o

    Corey Milner
    Creative Director, Indigo Rose Software

    Comment

    Working...
    X