diff test/c3examples/functions.c3 @ 284:05184b95fa16

Moved tests to seperate folder
author Windel Bouwman
date Fri, 15 Nov 2013 13:43:22 +0100
parents python/c3/examples/functions.c3@6ed3d3a82a63
children d9df72971cbf
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/c3examples/functions.c3	Fri Nov 15 13:43:22 2013 +0100
@@ -0,0 +1,27 @@
+
+/*
+ Demo of function usage
+*/
+
+package functiondemo;
+
+function void main()
+{
+    var int a, b, c;
+    a = 3;
+    b = a;
+    a =3;
+    b = fib(a + 9);
+    sum(a, b);
+}
+
+function int fib(int x)
+{
+    return fib(x - 1) * x;
+}
+
+function int sum(int a, int b)
+{
+    return a + b;
+}
+