X-Git-Url: https://ruin.nu/git/?p=proglang.git;a=blobdiff_plain;f=examples%2Ffunc;fp=examples%2Ffunc;h=fcebceb5f0c5fb97663d8986ef41603a29cc0ef7;hp=0000000000000000000000000000000000000000;hb=d606bc7eda59e30fbb75555b4d4c5da91b7327b9;hpb=99548e772decde168669179c0da03109a9df5356 diff --git a/examples/func b/examples/func new file mode 100644 index 0000000..fcebceb --- /dev/null +++ b/examples/func @@ -0,0 +1,12 @@ +int a = fac(3); +int b = fib(2); +int c = func(a,b); + +if (boolfunc(b,c)) print true; + +int fac(int n){ + n++; + int sum = 1; + while (n-- > 1) sum = sum * n; + return n; +}