Implements the classic Ackermann function, a recursive mathematical function that grows rapidly and demonstrates deep recursion in Haskell.
Make sure you have GHC (Glasgow Haskell Compiler) installed.
cd ackermann
ghc ackermann.hs -o ackermann
./ackermann 3 4 # Linux/macOS
.\ackermann.exe 3 4 # Windows
This program expects two integer arguments m
and n
corresponding to A(m, n)
in the Ackermann function.
Example:
./ackermann 3 4 # Linux/macOS
.\ackermann.exe 3 4 # Windows
The program prints the result of A(m, n)
.
Example output:
A(3, 4) = 125
This project is licensed under the MIT License.