Play with scripts
This commit is contained in:
parent
3d2c4719a6
commit
2f4be6f6a5
14
hello.ld
14
hello.ld
|
@ -1,10 +1,8 @@
|
||||||
fn fib {
|
fn fib (n) -> if eq (n, 0)
|
||||||
(0) -> 1
|
then 1
|
||||||
(1) -> 1
|
else if eq (n, 1)
|
||||||
(n) -> add (
|
then 1
|
||||||
fib (sub (n, 1)),
|
else add (fib (sub (n, 1)), fib (sub (n, 2)))
|
||||||
fib (sub (n, 2)))
|
|
||||||
}
|
|
||||||
|
|
||||||
fn fact {
|
fn fact {
|
||||||
(n) -> fact (n, 1)
|
(n) -> fact (n, 1)
|
||||||
|
@ -17,4 +15,4 @@ ns Recursive {
|
||||||
fib
|
fib
|
||||||
}
|
}
|
||||||
|
|
||||||
:factl (Recursive) (6)
|
Recursive :fib (25)
|
Loading…
Reference in New Issue
Block a user