% $Id: ackermann.cim,v 1.2 2002/05/16 15:30:00 dada Exp $
external class UNIX;
begin

    integer procedure Ack(m, n); integer m, n;
    begin
        if m = 0 then Ack := n + 1        
        else if n = 0 then Ack := Ack(m-1, 1)
        else Ack := Ack(m-1, Ack(m, n-1));
    end;

    integer i;
    text t;
    t :- Blanks(80);
    t := Arg(1);
    comment OutInt(Argc, 4);
    comment OutText(Arg(1));    
    i := t.getInt;
    if i < 1 then i := 1;
    OutText("Ack(3,");
    OutInt(i, 0);
    OutText("): ");
    OutInt(Ack(3, i), 0);
    OutImage;
end