aboutsummaryrefslogtreecommitdiffstats
path: root/samples/sample1.tunk
diff options
context:
space:
mode:
Diffstat (limited to 'samples/sample1.tunk')
-rw-r--r--samples/sample1.tunk14
1 files changed, 14 insertions, 0 deletions
diff --git a/samples/sample1.tunk b/samples/sample1.tunk
new file mode 100644
index 0000000..168421b
--- /dev/null
+++ b/samples/sample1.tunk
@@ -0,0 +1,14 @@
+triangle n = int.eq? n 1
+ 1
+ (int.add
+ n
+ (triangle (int.sub n 1)));
+
+triangle 500;
+
+# factorial n =
+# int.eq? n 0
+# 1
+# (int.mul n (factorial (int.sub n 1)));
+
+# factorial 20; \ No newline at end of file