Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
13
Task/Anonymous-recursion/Maple/anonymous-recursion-1.maple
Normal file
13
Task/Anonymous-recursion/Maple/anonymous-recursion-1.maple
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
Fib := proc( n :: nonnegint )
|
||||
proc( k )
|
||||
option remember; # automatically memoise
|
||||
if k = 0 then
|
||||
0
|
||||
elif k = 1 then
|
||||
1
|
||||
else
|
||||
# Recurse, anonymously
|
||||
thisproc( k - 1 ) + thisproc( k - 2 )
|
||||
end
|
||||
end( n )
|
||||
end proc:
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
> seq( Fib( i ), i = 0 .. 10 );
|
||||
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55
|
||||
|
||||
> Fib( -1 );
|
||||
Error, invalid input: Fib expects its 1st argument, n, to be of type
|
||||
nonnegint, but received -1
|
||||
Loading…
Add table
Add a link
Reference in a new issue