view python/c3/examples/functions.c3 @ 271:cf7d5fb7d9c8

Reorganization
author Windel Bouwman
date Tue, 20 Aug 2013 18:56:02 +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;
}