Desmond
06-24-2004, 03: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!
'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!