Last active
April 26, 2024 07:46
-
-
Save 53845714nF/688c85068575f1d8fbec731e4ce469ad to your computer and use it in GitHub Desktop.
The Ackermann function as Bash One-Liner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "define a(m,n){if(m==0){return(n+1)};if(m>0&&n==0){return (a(m-1,1))};if(m>0&&n>0){ return a(m-1,a(m,n-1))}}a(4,1)" | bc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment