-- $Id: ackermann.ghc,v 1.5 2001/06/16 01:33:06 doug Exp $ -- http://www.bagley.org/~doug/shootout/ -- shortened by Bryn Keller import System(getArgs) main = do ~[number] <- getArgs let n = read number in putStrLn ("Ack(3," ++ (show n) ++ "): " ++ (show (ack 3 n))) ack :: Int -> Int -> Int ack 0 n = n+1 ack m 0 = ack (m-1) 1 ack m n = ack (m-1) (ack m (n-1));