about summary refs log tree commit diff stats
path: root/transect/factorial.k2
diff options
context:
space:
mode:
Diffstat (limited to 'transect/factorial.k2')
-rw-r--r--transect/factorial.k216
1 files changed, 0 insertions, 16 deletions
diff --git a/transect/factorial.k2 b/transect/factorial.k2
deleted file mode 100644
index 79269773..00000000
--- a/transect/factorial.k2
+++ /dev/null
@@ -1,16 +0,0 @@
-# compute the factorial of 5, and return the result in the exit code
-
-fn factorial n : int -> result/EAX : int [
-  result/EAX <- copy 1
-  {
-    compare n, 1
-    break-if <=
-    var tmp/EBX : int
-    tmp/EBX <- copy n
-    tmp/EBX <- subtract 1
-    var tmp2/EAX : int
-    tmp2/EAX <- call factorial, tmp/EBX
-    result/EAX <- multiply tmp2/EAX, n
-  }
-  return result/EAX
-]