slige/examples/example_2.slg

25 lines
299 B
Plaintext
Raw Permalink Normal View History

2024-12-11 11:36:19 +00:00
fn add(a: int, b: int) -> int {
2024-12-12 14:37:56 +00:00
a + b
2024-11-20 21:12:08 +00:00
}
2024-12-11 11:36:19 +00:00
fn main() -> int {
let result = 0;
2025-01-17 06:44:53 +00:00
let a = 0;
let b = a;
let c = b;
let d = c;
let i = c;
2024-12-11 11:36:19 +00:00
loop {
2024-12-12 14:37:56 +00:00
if i >= 10 {
2024-12-11 11:36:19 +00:00
break;
}
result = add(result, 5);
2024-12-12 14:37:56 +00:00
i = i + 1;
2024-11-20 21:12:08 +00:00
}
2024-12-11 11:36:19 +00:00
result
2024-11-20 21:12:08 +00:00
}