From 2f4be6f6a58b55f46ecfc03270ab84a48ddf755b Mon Sep 17 00:00:00 2001 From: Scott Richmond Date: Thu, 28 Apr 2022 19:27:59 -0400 Subject: [PATCH] Play with scripts --- hello.ld | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/hello.ld b/hello.ld index fcf09cf..a7a8fdd 100644 --- a/hello.ld +++ b/hello.ld @@ -1,10 +1,8 @@ -fn fib { - (0) -> 1 - (1) -> 1 - (n) -> add ( - fib (sub (n, 1)), - fib (sub (n, 2))) -} +fn fib (n) -> if eq (n, 0) + then 1 + else if eq (n, 1) + then 1 + else add (fib (sub (n, 1)), fib (sub (n, 2))) fn fact { (n) -> fact (n, 1) @@ -17,4 +15,4 @@ ns Recursive { fib } -:factl (Recursive) (6) \ No newline at end of file +Recursive :fib (25) \ No newline at end of file