aboutsummaryrefslogtreecommitdiff
path: root/ack.kpl
diff options
context:
space:
mode:
Diffstat (limited to 'ack.kpl')
-rw-r--r--ack.kpl26
1 files changed, 0 insertions, 26 deletions
diff --git a/ack.kpl b/ack.kpl
deleted file mode 100644
index bba01ea..0000000
--- a/ack.kpl
+++ /dev/null
@@ -1,26 +0,0 @@
-
-// Ackermann function
-
-`export ack : ([I64; I64.m; I64.n]
- ? {
- |(m < 0; n < 0) { 0 }
- m = 0 { n + 1 }
- &(m > 0; n = 0) { ack `sync (m - 1; 1) }
- { ack `sync (m - 1; ack `sync (m; n - 1)) }
- }
-)
-
-`export ack_string : ([String; I64.m; I64.n]
- "#MAGENTA#ack#(#CYAN#%#, #CYAN#%#) #WHITE#=# #GREEN#%#\n" `format (m; n; ack `sync (m; n))
-)
-
-`is_main ([Void]
- `use "sys" [args]
- ? 4 != `length args {
- `return `error String $ (
- "#BOLD#RED#Got: %#\n" `format " " `join args
- "#BOLD#WHITE#Usage: % % <m> <n>#\n" `format (args `get 0; args `get 1)
- )
- }
- `value ack_string `sync (I64 $ args `get -2; I64 $ args `get -1)
-)