summaryrefslogtreecommitdiff
path: root/test.toc
diff options
context:
space:
mode:
Diffstat (limited to 'test.toc')
-rw-r--r--test.toc14
1 files changed, 10 insertions, 4 deletions
diff --git a/test.toc b/test.toc
index e2263b8..aa31aed 100644
--- a/test.toc
+++ b/test.toc
@@ -1,8 +1,14 @@
-factorial ::= fn(x: int) int {
- if x < 2 { 1 }
- else { x * factorial(x-1) }
+x := 10;
+
+twotothe ::= fn(x: int) int {
+ total := 1;
+ for i := 0..x-1 {
+ total += twotothe(i);
+ x += 1;
+ }
+ total
};
main ::= fn() {
- a ::= factorial(10);
+ a ::= twotothe(10);
}; \ No newline at end of file