Scientific Calculator
silentmatt/ackermann
The Ackermann Function. Be careful.
Tagged:
var Ackermann = function(m, n) {
m == 0 ?
n + 1
: m > 0 and n == 0 ?
Ackermann(m - 1, 1)
: m > 0 and n > 0 ?
Ackermann(m - 1, Ackermann(m, n - 1))
:
error()
};
0 Comments
Sign in to leave a comment