summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorNic Gaffney <gaffney_nic@protonmail.com>2025-02-19 18:28:18 -0600
committerNic Gaffney <gaffney_nic@protonmail.com>2025-02-19 18:28:18 -0600
commit4ea2876e8243a86276917e691a335caed7a8fd74 (patch)
tree79554a528e70d0a810692560f659ca6270a77f50 /examples
parentfe851bcb542dac5f3af312da02ff617aa817f118 (diff)
downloadcalico-4ea2876e8243a86276917e691a335caed7a8fd74.tar.gz
Added while loop
Diffstat (limited to 'examples')
-rw-r--r--examples/whiletest.nya10
1 files changed, 10 insertions, 0 deletions
diff --git a/examples/whiletest.nya b/examples/whiletest.nya
new file mode 100644
index 0000000..599c09a
--- /dev/null
+++ b/examples/whiletest.nya
@@ -0,0 +1,10 @@
+import fn puts(str: [u8]) -> i32;
+
+fn main() -> i32 {
+ varbl: i32 i = 0;
+ while (i < 10) {
+ puts("Hi ");
+ i = i + 1;
+ }
+ return 0;
+}