2024-12-11 12:36:19 +01:00
|
|
|
fn print(msg: string) #[builtin(print)] {}
|
2024-11-01 11:48:21 +01:00
|
|
|
|
2024-12-09 13:57:48 +01:00
|
|
|
fn sum(a: int, b: int) -> int {
|
|
|
|
+ a b
|
2024-11-01 11:48:21 +01:00
|
|
|
}
|
|
|
|
|
2024-12-10 14:36:41 +01:00
|
|
|
fn main() {
|
|
|
|
sum(2,3); // -> 5
|
2024-11-01 11:48:21 +01:00
|
|
|
|
2024-12-10 14:36:41 +01:00
|
|
|
let a: string = "Hello";
|
|
|
|
|
|
|
|
let b = "world";
|
2024-11-01 11:48:21 +01:00
|
|
|
|
2024-12-11 12:36:19 +01:00
|
|
|
print(+ + + a " " b "!\n"); // -> "Hello world!"
|
2024-11-01 11:48:21 +01:00
|
|
|
|
2024-12-10 14:36:41 +01:00
|
|
|
if == a b {
|
2024-12-11 12:36:19 +01:00
|
|
|
print("whaaaat\n");
|
2024-12-10 14:36:41 +01:00
|
|
|
}
|
|
|
|
else {
|
2024-12-11 12:36:19 +01:00
|
|
|
print(":o\n");
|
2024-12-10 14:36:41 +01:00
|
|
|
}
|
2024-11-01 11:48:21 +01:00
|
|
|
|
2024-12-10 14:36:41 +01:00
|
|
|
loop {
|
|
|
|
let i = 0;
|
2024-11-01 11:48:21 +01:00
|
|
|
|
2024-12-10 14:36:41 +01:00
|
|
|
if >= i 10 {
|
|
|
|
break;
|
|
|
|
}
|
2024-11-01 11:48:21 +01:00
|
|
|
|
2024-12-10 14:36:41 +01:00
|
|
|
i = + i 1;
|
|
|
|
}
|
|
|
|
}
|