mirror of
https://git.sfja.dk/Mikkel/slige.git
synced 2025-01-18 13:06:30 +00:00
33 lines
434 B
Plaintext
33 lines
434 B
Plaintext
fn print(msg: string) #[builtin(Print)] {}
|
|
|
|
fn sum(a: int, b: int) -> int {
|
|
a + b
|
|
}
|
|
|
|
fn main() {
|
|
sum(2,3); // -> 5
|
|
|
|
let a: string = "Hello";
|
|
|
|
let b = "world";
|
|
|
|
print(a + " " + b + "!\n"); // -> "Hello world!"
|
|
|
|
if a == b {
|
|
print("whaaaat\n");
|
|
}
|
|
else {
|
|
print(":o\n");
|
|
}
|
|
|
|
loop {
|
|
let i = 0;
|
|
|
|
if i >= 10 {
|
|
break;
|
|
}
|
|
|
|
i = i + 1;
|
|
}
|
|
}
|