view examples/c3/functions.c3 @ 367:577ed7fb3fe4

Try to make thumb work again
author Windel Bouwman
date Fri, 21 Mar 2014 10:27:57 +0100
parents 158068af716c
children
line wrap: on
line source


/*
 Demo of function usage
*/

module 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;
}