From 520c175a110f60caeb03c633919b304b234447b5 Mon Sep 17 00:00:00 2001 From: Donald Filimon <155747516+underswitchx@users.noreply.github.com> Date: Fri, 18 Jul 2025 15:56:22 -0400 Subject: [PATCH] Add example programs for OuroLang --- .../Ouroboros_Compiler/examples/hello_world.ouro | 8 ++++++++ .../Ouroboros_Compiler/examples/simple_calc.ouro | 16 ++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/Ouroboros/Ouroboros_Compiler/examples/hello_world.ouro b/Ouroboros/Ouroboros_Compiler/examples/hello_world.ouro index e69de29..5b48cd5 100644 --- a/Ouroboros/Ouroboros_Compiler/examples/hello_world.ouro +++ b/Ouroboros/Ouroboros_Compiler/examples/hello_world.ouro @@ -0,0 +1,8 @@ +fn greet(name: string) { + print("Hello,", name); +} + +fn main() { + let user: string = "World"; + greet(user); +} diff --git a/Ouroboros/Ouroboros_Compiler/examples/simple_calc.ouro b/Ouroboros/Ouroboros_Compiler/examples/simple_calc.ouro index e69de29..ef30b0c 100644 --- a/Ouroboros/Ouroboros_Compiler/examples/simple_calc.ouro +++ b/Ouroboros/Ouroboros_Compiler/examples/simple_calc.ouro @@ -0,0 +1,16 @@ +fn add(a: int, b: int) -> int { + return a + b; +} + +fn main() { + let result: int = add(2, 3); + if result > 4 { + print("Result is greater than 4", result); + } else { + print("Result is", result); + } + + for i in 0..5 { + print(i); + } +}