Mutual recursion: Difference between revisions
Content deleted Content added
m →{{header|Sidef}}: updated code |
|||
Line 2,677:
| n-1
check for zero</lang>
=={{header|SPL}}==
<lang spl>f(n)=
? n=0, <= 1
<= n-m(f(n-1))
.
m(n)=
? n=0, <= 0
<= n-f(m(n-1))
.
> i, 0..20
fs += " "+f(i)
ms += " "+m(i)
<
#.output("F:",fs)
#.output("M:",ms)</lang>
{{out}}
<pre>
F: 1 1 2 2 3 3 4 5 5 6 6 7 8 8 9 9 10 11 11 12 13
M: 0 0 1 2 2 3 4 4 5 6 6 7 7 8 9 9 10 11 11 12 12
</pre>
=={{header|Standard ML}}==
|