mirror of
https://github.com/MorizzG/MLox.git
synced 2025-12-06 04:22:41 +00:00
12 lines
204 B
Lox
12 lines
204 B
Lox
fun isEven(n) {
|
|
if (n == 0) return true;
|
|
return isOdd(n - 1);
|
|
}
|
|
|
|
fun isOdd(n) {
|
|
if (n == 0) return false;
|
|
return isEven(n - 1);
|
|
}
|
|
|
|
print isEven(4); // expect: true
|
|
print isOdd(3); // expect: true
|