Mutual recursion: Difference between revisions

Content deleted Content added
Poulteki (talk | contribs)
Poulteki (talk | contribs)
Line 312: Line 312:
=={{header|Bc}}==
=={{header|Bc}}==


<lang bc>define f(n) {
<lang bc>cat mutual_recursion.bc:
define f(n) {
if ( n == 0 ) return(1);
if ( n == 0 ) return(1);
return(n - m(f(n-1)));
return(n - m(f(n-1)));
Line 334: Line 335:
print m(i); print " ";
print m(i); print " ";
}
}
print "\n";</lang>
print "\n";
quit</lang>

{{out}}
<pre>
GNU bc mutual_recursion.bc
bc 1.06.95
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
1 1 2 2 3 3 4 5 5 6 6 7 8 8 9 9 10 11 11 12 13
0 0 1 2 2 3 4 4 5 6 6 7 7 8 9 9 10 11 11 12 12
</pre>


=={{header|Bracmat}}==
=={{header|Bracmat}}==