Old lady swallowed a fly: Difference between revisions

Added XPL0 example.
(→‎{{header|jq}}: def cond(_;_))
(Added XPL0 example.)
Line 4,052:
 
sing.call()</syntaxhighlight>
 
=={{header|XPL0}}==
{{trans|C}}
<syntaxhighlight lang "XPL0">include xpllib; \For Print
 
int Animals, Verses, I, J;
[Animals:= ["fly", "spider", "bird", "cat", "dog", "goat", "cow", "horse"];
Verses:= [
"I don't know why she swallowed that fly.^m^jPerhaps she'll die^m^j",
"That wiggled and jiggled and tickled inside her",
"How absurd, to swallow a bird",
"Imagine that. She swallowed a cat",
"What a hog to swallow a dog",
"She just opened her throat and swallowed that goat",
"I don't know how she swallowed that cow",
"She's dead of course" ];
for I:= 0 to 8-1 do
[Print("There was an old lady who swallowed a %s\n%s\n", Animals(I), Verses(I));
J:= I;
while J > 0 and I < 8-1 do
[Print("She swallowed the %s to catch the %s\n", Animals(J), Animals(J-1));
if J = 1 then Print("%s\n", Verses(0));
J:= J-1;
]
]
]</syntaxhighlight>
 
=={{header|Z80 Assembly}}==
297

edits