slige/examples/string_int_args.slg

26 lines
354 B
Plaintext
Raw Normal View History

2024-12-13 06:09:10 +01:00
fn print(msg: string) #[builtin(Print)] {}
fn repeat(value: string, amount: int) -> string {
let result = "";
let i = 0;
loop {
if not (i < amount) {
break;
}
result = result + value;
i = i + 1;
}
result
}
fn main() {
let value = repeat("hello world\n", 3);
print(value);
}