Add all the A tasks

This commit is contained in:
Ingy döt Net 2013-04-10 14:58:50 -07:00
parent 2dd7375f96
commit 051504d65b
1608 changed files with 18584 additions and 0 deletions

View file

@ -0,0 +1,11 @@
/*REXX program to show anonymous recursion (of a function/subroutine). */
numeric digits 1e6 /*in case the user goes kaa-razy.*/
do j=0 to word(arg(1) 12, 1) /*use argument or the default: 12*/
say 'fibonacci('j") =" fib(j) /*show Fibonacci sequence: 0──►x */
end /*j*/
exit /*stick a fork in it, we're done.*/
/*──────────────────────────────────subroutines─────────────────────────*/
fib: procedure; if arg(1)>=0 then return .(arg(1))
say "***error!*** argument can't be negative."; exit
.:procedure; arg _; if _<2 then return _; return .(_-1)+.(_-2)