Add functions and lists
This commit is contained in:
11
tests/fibonacci.ppl
Normal file
11
tests/fibonacci.ppl
Normal file
@@ -0,0 +1,11 @@
|
||||
(let fib (function int [int y function fib]
|
||||
(let retval 0)
|
||||
(if (== 1 y) (set retval 0))
|
||||
(if (== 2 y) (set retval 1))
|
||||
(if (> y 2)
|
||||
(set retval (+ (fib (- y 1) fib) (fib (- y 2) fib)))
|
||||
)
|
||||
(return retval)
|
||||
))
|
||||
|
||||
(print (fib 30 fib))
|
||||
Reference in New Issue
Block a user