summaryrefslogtreecommitdiff
path: root/jni/ruby/benchmark/other-lang/ack.py
blob: 9968e7cfcf76a0aa9d3365a31f46468288bd3bde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import sys
sys.setrecursionlimit(5000000)

def Ack(M, N):
    if (not M):
        return( N + 1 )
    if (not N):
        return( Ack(M-1, 1) )
    return( Ack(M-1, Ack(M, N-1)) )

def main():
    NUM = 9
    sys.setrecursionlimit(10000)
    Ack(3, NUM)

main()