mirror of
https://github.com/dragonheim/gagent.git
synced 2025-02-23 05:49:53 -08:00
9 lines
106 B
Tcl
9 lines
106 B
Tcl
proc fib {x} {
|
|
if {<= $x 1} {
|
|
return 1
|
|
} else {
|
|
+ [fib [- $x 1]] [fib [- $x 2]]
|
|
}
|
|
}
|
|
|
|
puts [fib 20]
|