added grace support

This commit is contained in:
Aloke Desai
2014-06-27 19:58:53 -07:00
parent 526244be11
commit 85dbcb5444
4 changed files with 797 additions and 3 deletions

View File

@@ -0,0 +1,6 @@
method ack (m : Number, n : Number) -> Number {
print "ack {m} {n}"
if (m < = 0) then {n + 1}
elseif {n <= 0} then {ack((m -1), 1)}
else {ack(m -1, ack(m, n-1))}
}