Source

blaise / examples / ackermann.bl

Full commit
ackermann(m,n)
{
    if (m == 0)
    {
        return n + 1;
    }
    else
    {
        if (n == 0)
        {
            return ackermann(m - 1, 1);
        }
        else
        {
            return ackermann(m - 1, ackermann(m, n - 1));
        }
    }
}

main()
{
    vars a, b;
    a = read();
    b = read();
    write(ackermann(a, b));
}