view test/c3examples/functions.c3 @ 286:d9df72971cbf

Changed package to module
author Windel Bouwman
date Fri, 15 Nov 2013 13:52:32 +0100
parents 05184b95fa16
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;
}