From b5111570d2de58741d2d932cb149dfe5aea39d1b Mon Sep 17 00:00:00 2001 From: nodist Date: Sat, 8 Aug 2026 08:45:17 -0400 Subject: reset --- fib.kpl | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 fib.kpl (limited to 'fib.kpl') diff --git a/fib.kpl b/fib.kpl deleted file mode 100644 index d8a2140..0000000 --- a/fib.kpl +++ /dev/null @@ -1,39 +0,0 @@ - -// Fibonacci sequence - -`export fib_recursive : {[I64.n] - ? { - n < 0 { %.error ~ "#BOLD#RED#Invalid n Got %#" `format n } - n = 0 { 0 } - n < 2 { 1 } - { + (fib `sync n - 1; fib `sync n - 2) } - } -} - -`export fib_iterative : {[I64.n] - ? n < 0 { - `return.error ~ "#BOLD#RED#Invalid n Got %#" `format n - } - a : 0 - b : 1 - @ 0 .. n { - c : b - b : a + b - a : c - } - a -} - -`export fib_array : {[I64.n] - ? { - n < 0 { - `return.error ~ "#BOLD#RED#Invalid n Got %#" `format n - } - n > 0 { n :- 1 } - } - arr : Array $ (0; 1) - @ 0 .. n { - arr `push + (arr `get -2; arr `get -1) - } - arr -} -- cgit v1.2.3