RosettaCodeData/Task/Mutual-recursion/Run-BASIC/mutual-recursion.run
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

19 lines
277 B
Text

print "F sequence:";
for i = 0 to 20
print f(i);" ";
next i
print :print "M sequence:";
for i = 0 to 20
print m(i);" ";
next i
end
function f(n)
f = 1
if n <> 0 then f = n - m(f(n - 1))
end function
function m(n)
m = 0
if n <> 0 then m = n - f(m(n - 1))
end function