Jump to content

Mutual recursion: Difference between revisions

m
→‎{{header|REXX}}: added comments, added DO-END comment labels. -- ~~~~
m (→‎with memoization, specific entry: added a comment. -- ~~~~)
m (→‎{{header|REXX}}: added comments, added DO-END comment labels. -- ~~~~)
Line 1,589:
do j=0 to lim; jj=Jw(j); ff=F(j); mm=M(j)
say pad 'F('jj") =" Jw(ff) pad 'M('jj") =" Jw(mm)
end /*j*/
exit /*stick a fork in it, we're done.*/
exit
/*─────────────────────────────────────F, M, Jw subroutines────────────*/
F: procedure; arg n; if n==0 then return 1; return n-M(F(n-1))
Line 1,647:
do j=0 to lim; ff=F(j); mm=M(j)
Js=Js jW(j); Fs=Fs jw(ff); Ms=Ms jW(mm)
end /*j*/
say 'Js=' Js
say 'Fs=' Fs
Cookies help us deliver our services. By using our services, you agree to our use of cookies.