Add all the A tasks
This commit is contained in:
parent
2dd7375f96
commit
051504d65b
1608 changed files with 18584 additions and 0 deletions
9
Task/Anonymous-recursion/Tcl/anonymous-recursion-3.tcl
Normal file
9
Task/Anonymous-recursion/Tcl/anonymous-recursion-3.tcl
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
proc fib n {
|
||||
if {[incr n 0] < 0} {error "argument may not be negative"}
|
||||
apply {x {expr {
|
||||
$x < 2
|
||||
? $x
|
||||
: [apply [lindex [info level 0] 1] [incr x -1]]
|
||||
+ [apply [lindex [info level 0] 1] [incr x -1]]
|
||||
}}} $n
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue