reid-llvm/examples/loops.reid
2025-07-23 21:17:16 +03:00

23 lines
376 B
Plaintext

// Arithmetic, function calls and imports!
import std::print;
import std::new_string;
import std::add_num_to_str;
import std::free_string;
fn main() -> u32 {
for i in 0 .. 5 {
let mut text = new_string();
add_num_to_str(&mut text, i);
print(&text);
free_string(&mut text);
}
let mut num = 0;
while num < 10 {
num = num + 1;
}
return num;
}