Old lady swallowed a fly: Difference between revisions

m
(→‎{{header|TXR}}: Fix incorrect output: S not expanded to snake; letter T in "That" expanded to cat.)
imported>Arakov
 
(2 intermediate revisions by 2 users not shown)
Line 1,443:
for n from 0 upto 7 do verse(n) od
corp</syntaxhighlight>
 
=={{header|EasyLang}}==
{{trans|C}}
<syntaxhighlight>
animals$[] = [ "fly" "spider" "bird" "cat" "dog" "goat" "cow" "horse" ]
verses$[] = [ "I don't know why she swallowed that fly.\nPerhaps she'll die\n" "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 to len animals$[]
print "There was an old lady who swallowed a " & animals$[i]
print verses$[i]
if i < len animals$[]
for j = i downto 2
print "She swallowed the " & animals$[j] & " to catch the " & animals$[j - 1]
if j = 2
print verses$[1]
.
.
.
.
</syntaxhighlight>
 
 
=={{header|Elena}}==
ELENA 56.0x :
<syntaxhighlight lang="elena">import extensions;
Line 1,463 ⟶ 1,483:
public program()
{
for(int i := 0,; i < Creatures.Length,; i += 1)
{
console
Line 1,471 ⟶ 1,491:
if(i != 0 && i != Creatures.Length - 1)
{
for(int j := i,; j > 0,; j -= 1)
{
console.printLineFormatted("She swallowed the {0} to catch the {1}",Creatures[j],Creatures[j - 1])
Line 4,138 ⟶ 4,158:
=={{header|Wren}}==
{{trans|Kotlin}}
<syntaxhighlight lang="ecmascriptwren">var animals = ["fly", "spider", "bird", "cat","dog", "goat", "cow", "horse"]
 
var phrases = [
Anonymous user