- prontera,155,188,0 script recursive_Fibonacci 910,{
- function fibonacci;
- for (set .@i,0; .@i<=15; set .@i,.@i+1) {
- dispbottom "fibonacci("+.@i+") = " + fibonacci(.@i);
- }
- end;
- // http://en.wikipedia.org/wiki/Fibonacci_number
- function fibonacci {
- set .@n, getarg(0);
- if (.@n < 2)
- return .@n;
- return ( fibonacci(.@n-1) + fibonacci(.@n-2) );
- }
- }
recursive_Fibonacci.txt
Posted by Anonymous on Thu 11th Oct 2012 19:15
raw | new post
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.