diff options
| author | Nic Gaffney <gaffney_nic@protonmail.com> | 2025-02-18 17:13:13 -0600 |
|---|---|---|
| committer | Nic Gaffney <gaffney_nic@protonmail.com> | 2025-02-18 17:13:13 -0600 |
| commit | 296564bbced8c3fa197ede9b16af60a4f88e350f (patch) | |
| tree | 7d3e4c1c4a8b68e2ee4a9d38dddf9b6b982aaadf /examples | |
| parent | 8f2595c71bce8d2f14de334d6e1b6378cc9f7cbf (diff) | |
| parent | 7db4d88fe0455a6f3bd58414afa0565cd4a74f9d (diff) | |
| download | calico-296564bbced8c3fa197ede9b16af60a4f88e350f.tar.gz | |
Merge branch 'repairBranch'
Restored lost progress from previous `git push --force`
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/helloWorld.nya | 8 | ||||
| -rw-r--r-- | examples/mathTest.nya | 18 |
2 files changed, 26 insertions, 0 deletions
diff --git a/examples/helloWorld.nya b/examples/helloWorld.nya new file mode 100644 index 0000000..625860c --- /dev/null +++ b/examples/helloWorld.nya @@ -0,0 +1,8 @@ +import fn puts(str: [u8]) -> i32; + +fn main() -> i32 { + varbl: i32 pog = puts("Hello World!"); + pog = 8; + const value = pog; + return value; +} diff --git a/examples/mathTest.nya b/examples/mathTest.nya new file mode 100644 index 0000000..f937b79 --- /dev/null +++ b/examples/mathTest.nya @@ -0,0 +1,18 @@ +import fn puts(str: [u8]) -> i32; + +fn test() -> i32 { + const: i32 pog = 5; + return pog; +} + +fn main() -> i32 { + const: i32 num = 5; + const: i32 num2 = test(); + if (num2 == test()) { + puts("Hello World!"); + } + if (num2 == 0) { + puts("Shouldn't print"); + } + return num2; +} |
