Cecil
19+ years progress programming and still learning.
The ABL Ackermann's function
So, if you have a client(s) that are behind on payments, stick this code in your programs. It will either 'error' or slow down the system. NOTE: Don't do this.
Inspired by this YouTube video:
ABL Dojo:
ABL Dojo
So, if you have a client(s) that are behind on payments, stick this code in your programs. It will either 'error' or slow down the system. NOTE: Don't do this.
Inspired by this YouTube video:
ABL Dojo:
ABL Dojo
Code:
/* int ack(m,n) */
/* int m,n; */
/* { */
/* int ans; */
/* if (m == 0) ans = n+1; */
/* else if (n == 0) ans = ack(m-1,1); */
/* else ans = ack(m-1, ack(m,n-1)); */
/* return (ans); */
/* } */
function ack return int64(input m as int64,
input n as int64):
define variable answer as int64 no-undo.
case true:
when m eq 0 then
answer = n + 1.
when n eq 0 then
answer = ack(m - 1, 1).
otherwise
answer = ack(m - 1, ack( m , n - 1)).
end case.
return int64.
end function.
ack(random(0,9) , random(0,9) ).
Last edited: