PDA

View Full Version : Example: AutoPlay Media Studio 5.0 & Recursion



Desmond
06-24-2004, 04:56 PM
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).


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
06-24-2004, 06:32 PM
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 (http://www.indigorose.com)