view python/c3/examples/functions.c3 @ 259:ac603eb66b63

Added function call
author Windel Bouwman
date Mon, 05 Aug 2013 20:41:25 +0200
parents 6ed3d3a82a63
children
line wrap: on
line source


/*
 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;
}