summaryrefslogtreecommitdiffstats
path: root/test/test.snt
diff options
context:
space:
mode:
Diffstat (limited to 'test/test.snt')
-rw-r--r--test/test.snt15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/test.snt b/test/test.snt
new file mode 100644
index 0000000..32f1eab
--- /dev/null
+++ b/test/test.snt
@@ -0,0 +1,15 @@
+: fact_rec
+ dup 1 != if
+ dup rot * swap 1 - fact_rec
+ then
+;
+
+: fact ( recursive factorial function )
+ 1 swap fact_rec pop
+;
+
+: main
+ 1 begin
+ dup ": strcat 15 fact spacecat notify
+ 1 + dup 1000 > until
+;