mirror of
https://github.com/antirez/aocla
synced 2024-12-27 09:58:32 +01:00
Fibonacci example.
This commit is contained in:
parent
d4d5b59bca
commit
33f28950a0
1 changed files with 16 additions and 0 deletions
16
examples/fib.aocla
Normal file
16
examples/fib.aocla
Normal file
|
@ -0,0 +1,16 @@
|
|||
// Fibonacci example
|
||||
|
||||
[(n)
|
||||
[$n 1 <=]
|
||||
[
|
||||
$n
|
||||
]
|
||||
[
|
||||
$n 1 - fib
|
||||
$n 2 - fib
|
||||
+
|
||||
] ifelse
|
||||
] 'fib def
|
||||
|
||||
10 fib
|
||||
printnl
|
Loading…
Reference in a new issue