Ackermann function: Difference between revisions
Content deleted Content added
No edit summary |
|||
Line 6,064:
:else
(ackermann m-1 (ackermann m n-1)))</lang>
=={{header|Wren}}==
<lang wren>
// To use recursion definition and declaration must be on separate lines
var Ackermann
Ackermann = Fn.new {|m, n|
if (m == 0) return n + 1
if (n == 0) return Ackermann.call(m - 1, 1)
return Ackermann.call(m - 1, Ackermann.call(m, n - 1))
}
</lang>
=={{header|XPL0}}==
|