about summary refs log tree commit diff
path: root/examples/12.src
diff options
context:
space:
mode:
authorBaitinq <[email protected]>2025-06-11 00:16:17 +0200
committerBaitinq <[email protected]>2025-06-11 00:16:17 +0200
commitfa92a157746ae17f295d31b7a047dfeb99624a13 (patch)
tree71e469e67a70df15542d873ebe223654def6111b /examples/12.src
parentstdlib: Remove println (diff)
downloadpry-lang-fa92a157746ae17f295d31b7a047dfeb99624a13.tar.gz
pry-lang-fa92a157746ae17f295d31b7a047dfeb99624a13.tar.bz2
pry-lang-fa92a157746ae17f295d31b7a047dfeb99624a13.zip
Misc: Rename lang
Diffstat (limited to 'examples/12.src')
-rw-r--r--examples/12.src51
1 files changed, 0 insertions, 51 deletions
diff --git a/examples/12.src b/examples/12.src
deleted file mode 100644
index 1193e4c..0000000
--- a/examples/12.src
+++ /dev/null
@@ -1,51 +0,0 @@
-import "!stdlib.src";
-
-let main = () => i64 {
-    let factorial = (n: i64) => i64 {
-        let f = (acc: i64, n: i64) => i64 {
-            if n == 0 {
-                return acc;
-            };
-            return f(acc * n, n - 1);
-        };
-        return f(1, n);
-    };
-
-    let is_even = (n: i64) => bool {
-        if n % 2 == 0 {
-            return true;
-        };
-        return false;
-    };
-
-    let sum_if = (predicate: (i64) => bool, limit: i64) => i64 {
-        let sum = 0;
-        let i = 0;
-        while i < limit {
-            if predicate(i) {
-                sum = sum + i;
-            };
-            i = i + 1;
-        };
-        return sum;
-    };
-
-    let fact_val = factorial(6);
-    printf("%d\n", fact_val);
-
-    let even_sum = sum_if(is_even, 20);
-    printf("%d\n", even_sum);
-
-    return 0;
-};
-
-/*
-
-Expected stdout:
-
-720
-90
-
-Expected return: 0
-
-*/