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); + } +}