Ackermann function: Difference between revisions
Content deleted Content added
No edit summary |
|||
Line 3,631:
else ackermann(m-1,ackermann(m,n-1))
)</lang>
=={{header|M2000 Interpreter}}==
<lang M2000 Interpreter>
Module Checkit {
Def ackermann(m,n) =If(m=0-> n+1, If(n=0-> ackermann(m-1,1), ackermann(m-1,ackermann(m,n-1))))
For m = 0 to 3 {For n = 0 to 4 {Print m;" ";n;" ";ackermann(m,n)}}
}
Checkit
Module Checkit {
Module Inner (ack) {
For m = 0 to 3 {For n = 0 to 4 {Print m;" ";n;" ";ack(m,n)}}
}
Inner lambda (m,n) ->If(m=0-> n+1, If(n=0-> lambda(m-1,1),lambda(m-1,lambda(m,n-1))))
}
Checkit
</lang>
=={{header|M4}}==
|