slige/examples/example_2.slg

18 lines
232 B
Plaintext
Raw Normal View History

2024-12-11 12:36:19 +01:00
fn add(a: int, b: int) -> int {
2024-11-20 22:12:08 +01:00
+ a b
}
2024-12-11 12:36:19 +01:00
fn main() -> int {
let result = 0;
let i = 0;
loop {
if >= i 10 {
break;
}
result = add(result, 5);
i = + i 1;
2024-11-20 22:12:08 +01:00
}
2024-12-11 12:36:19 +01:00
result
2024-11-20 22:12:08 +01:00
}