refactoring of the instruction table; removed unused instructions PUSHTYPTYP and ERROR; new modulo operator %; new examples fibonacci.noja and isprime.noja

This commit is contained in:
cozis
2022-12-07 18:31:35 +01:00
parent d483822538
commit 98374ee491
12 changed files with 194 additions and 11453 deletions
+17
View File
@@ -0,0 +1,17 @@
fun fibonacci(n: int) {
if n < 0:
error("Only non-negative integers allowed");
if n == 0 or n == 1:
return 1;
if n == 2:
return 2;
return fibonacci(n-1)
+ fibonacci(n-2);
}
print(fibonacci(10), "\n");