Jump to content

Mutual recursion: Difference between revisions

SNUSP!!!
(→‎{{header|Haskell}}: Simplified.)
(SNUSP!!!)
Line 562:
ra displayNl.
rb displayNl.</lang>
 
=={{header|SNUSP}}==
The program shown calculates F(3) and demonstrates simple and mutual recursion.
<lang SNUSP>
/======\
F==!/=!\?\+# | />-<-\
| \@\-@/@\===?/<#
| | |
$+++/======|====/
! /=/ /+<<-\
| \!/======?\>>=?/<# dup
| \<<+>+>-/
! !
\======|====\
| | |
| /===|==\ |
M==!\=!\?\#| | |
\@/-@/@/===?\<#
^ \>-<-/
| ^ ^ ^ ^
| | | | subtract from n
| | | mutual recursion
| | recursion
| n-1
check for zero
</lang>
 
=={{header|UNIX Shell}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.