view examples/c3/functions.c3 @ 387:34ac19044b8a

Hello world with paging in emulator
author Windel Bouwman
date Thu, 01 May 2014 22:09:18 +0200
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;
}