mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-15 19:28:47 +00:00
Function tests in interpretation
This commit is contained in:
parent
44b8a96e34
commit
784cc6510d
7 changed files with 65 additions and 1 deletions
12
regression/test032.expr
Normal file
12
regression/test032.expr
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
fun ack (m, n) {
|
||||
if m == 0 then return n+1
|
||||
elif m > 0 && n == 0 then return ack (m-1, 1)
|
||||
else return ack (m-1, ack (m, n-1))
|
||||
fi
|
||||
}
|
||||
|
||||
for m := 0, m <= 3, m := m+1 do
|
||||
for n := 0, n <= 8, n := n+1 do
|
||||
write (ack (m, n))
|
||||
od
|
||||
od
|
||||
Loading…
Add table
Add a link
Reference in a new issue