Albedo

Joined 24 August 2022
languages added
(→‎Ackermann Function: Program flow and stack developnent for A(2,0))
(languages added)
 
(3 intermediate revisions by the same user not shown)
Line 1:
{{mylangbegin}}
{{mylang|Piet|IntermediatePro}}
{{mylang|Julia|BeginnerIntermediate}}
{{mylang|Cardinal|IntermediatePro}}
{{mylang|DUP|Intermediate}}
{{mylang|FALSE|Intermediate}}
{{mylang|Beeswax|Creator}}
{{mylang|Glee|Beginner}}
{{mylang|Q'Nial|Beginner}}
{{mylangend}}
 
Line 379 ⟶ 384:
 
|}
 
This is a naive implementation that does not use any optimization. Explanation follows soon.
 
Example output:
 
? 3
? 5
253
 
 
Program flow (see explanation of the shorthand codes at the top of the page), with labels:
Line 504 ⟶ 500:
A(0,2) = 3 ,A(m,n)= n+1 if m=0
 
The coefficients and the results can be found inon the stack. See the places marked with square brackets [] and Labels in the program/stack flow above.
At each turn, the upper two values on the stack are flipped, so they are in the proper order for computing inner functions. For highly nested A(...,(A(A(A(...))))) functions the stack can grow to enormous proportions very fast, then computing its way outwards again, from innermost functions outwards. The innermost coefficients are always on top of the stack.
 
136

edits