Mercurial > lcfOS
annotate 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 |
rev | line source |
---|---|
251 | 1 |
2 /* | |
3 Demo of function usage | |
4 */ | |
5 | |
6 package functiondemo; | |
7 | |
8 function void main() | |
9 { | |
10 var int a, b, c; | |
11 a = 3; | |
12 b = a; | |
13 a =3; | |
14 b = fib(a + 9); | |
15 sum(a, b); | |
16 } | |
17 | |
18 function int fib(int x) | |
19 { | |
20 return fib(x - 1) * x; | |
21 } | |
22 | |
23 function int sum(int a, int b) | |
24 { | |
25 return a + b; | |
26 } | |
27 |