Anonymous user
Mutual recursion: Difference between revisions
m
→vanilla: removed last blank line in program.
m (→{{header|REXX}}: added more whitespace to output notes.) |
m (→vanilla: removed last blank line in program.) |
||
Line 1,739:
F: procedure; parse arg n; if n==0 then return 1; return n-M(F(n-1))
M: procedure; parse arg n; if n==0 then return 0; return n-F(M(n-1))
Jw: return right(arg(1),length(lim)) /*right justifies # for nice look*/</lang>
'''output''' using the default input of: <tt> 40 </tt>
<pre style="height:30ex">
Line 1,785 ⟶ 1,784:
F(40) = 25 M(40) = 25
</pre>
===with memoization===
This version uses memoization as well as a horizontal output format.
|