Swift version of the Ackermann Function. You can read more about the Ackermann Function here. If you'd like to watch a video about it, check out this video from Computerphile.
Realistically, the highest value of Ackermann you will be able to compute on your machine is Ackermann(4, 1), with a value of 65533. This will take a few minutes and use about 25GB of RAM.
I made two modifications to the program when translating it from C.
-
Using
Int32
. This is to save memory. -
Using
UnsafeMutablePointer
s. Calling this program without using pointers quickly causes it to crash and run out of memory. Using pointers overcomes this.
My name is Adam Boyd.
Your best bet to contact me is on Twitter. @MrAdamBoyd
My website is adamjboyd.com.
MIT