Mutual recursion: Difference between revisions
Content added Content deleted
Underscore (talk | contribs) (→{{header|Haskell}}: Simplified.) |
(SNUSP!!!) |
||
Line 562: | Line 562: | ||
ra displayNl. |
ra displayNl. |
||
rb displayNl.</lang> |
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}}== |
=={{header|UNIX Shell}}== |