mirror of
https://git.sfja.dk/Mikkel/slige.git
synced 2025-01-18 12:46:31 +00:00
26 lines
354 B
Plaintext
26 lines
354 B
Plaintext
|
|
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);
|
|
}
|
|
|