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-12-12 15:37:56 +01:00
a + b
2024-11-20 22:12:08 +01:00
}
2024-12-11 12:36:19 +01:00
fn main() -> int {
let result = 0;
let i = 0;
loop {
2024-12-12 15:37:56 +01:00
if i >= 10 {
2024-12-11 12:36:19 +01:00
break;
}
result = add(result, 5);
2024-12-12 15:37:56 +01:00
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
}