- Add comments and test for it - Add semicolon as required end of some expressions - Add new arguments parser - Add multi-file compilation - Add colors in output
25 lines
392 B
Plaintext
25 lines
392 B
Plaintext
int fib(int n)
|
|
{
|
|
if (n <= 1)
|
|
return n;
|
|
|
|
return fib(n - 1) + fib(n - 2);
|
|
}
|
|
|
|
uint sum(uint a, uint b)
|
|
{
|
|
return a + b;
|
|
}
|
|
|
|
printline("Test #1: fibonacci");
|
|
int result = fib(7);
|
|
if (result == 13)
|
|
printline("Recurse test passed");
|
|
else printline("Recurse test failed");
|
|
|
|
printline("Test #2: sum");
|
|
if (sum(2, 2) == 4)
|
|
printline("Sum test passed");
|
|
else printline("Sum test failed");
|
|
|