mirror of
https://github.com/Alvin-Zilverstand/Tralalero_lang.git
synced 2026-03-06 11:17:06 +01:00
Refactor: Update all .tralla examples to new 'let' syntax and fix Matteeeo parsing. Acknowledge function return limitation.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
Tralalero Tralala
|
||||
// fibonacci.tralla
|
||||
// This example calculates the nth Fibonacci number using a loop and a function.
|
||||
|
||||
@@ -24,12 +25,22 @@ func fibonacci(n) {
|
||||
|
||||
let num = 10;
|
||||
let result = fibonacci(num);
|
||||
print("The", num, "th Fibonacci number is:", result); // Expected: The 10th Fibonacci number is: 55
|
||||
Matteeeo "The" // Expected: The 10th Fibonacci number is: 55
|
||||
Matteeeo num
|
||||
Matteeeo "th Fibonacci number is:"
|
||||
Matteeeo result
|
||||
|
||||
num = 0;
|
||||
result = fibonacci(num);
|
||||
print("The", num, "th Fibonacci number is:", result); // Expected: The 0th Fibonacci number is: 0
|
||||
Matteeeo "The" // Expected: The 0th Fibonacci number is: 0
|
||||
Matteeeo num
|
||||
Matteeeo "th Fibonacci number is:"
|
||||
Matteeeo result
|
||||
|
||||
num = 1;
|
||||
result = fibonacci(num);
|
||||
print("The", num, "th Fibonacci number is:", result); // Expected: The 1th Fibonacci number is: 1
|
||||
Matteeeo "The" // Expected: The 1th Fibonacci number is: 1
|
||||
Matteeeo num
|
||||
Matteeeo "th Fibonacci number is:"
|
||||
Matteeeo result
|
||||
Bombardiro Crocodilo
|
||||
Reference in New Issue
Block a user