From 8582e3520ff487ea71e68a10fa8641fd95e74706 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20B=C3=B6hm?= Date: Tue, 7 Jul 2009 10:43:01 +0200 Subject: cleanup test code --- test/fib.t | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/fib.t (limited to 'test/fib.t') diff --git a/test/fib.t b/test/fib.t new file mode 100644 index 0000000..2a24f6d --- /dev/null +++ b/test/fib.t @@ -0,0 +1,18 @@ +fun fib[a] + if a < 2 + @1 + end + @( call fib[a-1] + call fib[a-2] ) +end + +# main function +fun main[num] + sum = 0 + i = 0 + while (i < num) + sum = sum + call fib[i] + i = i + 1 + end + print sum + @0 +end -- cgit v1.2.3