reid-llvm/examples/reid/easiest.reid

21 lines
306 B
Plaintext
Raw Permalink Normal View History

2023-07-27 16:40:12 +02:00
// Hello, comment here!
2023-08-02 16:03:06 +02:00
import std::print;
fn main() {
2023-08-03 19:08:20 +02:00
let hello = 32 + {
2023-08-03 20:24:57 +02:00
2 + 3
2023-08-03 19:08:20 +02:00
};
let beep = hello + fibonacci();
return beep;
2023-08-03 19:30:00 +02:00
}
// Fibonacci
fn fibonacci(value: i32) -> i32 {
if value < 3 {
return 1;
}
return fibonacci(value - 1) + fibonacci(value - 2);
}