Old lady swallowed a fly: Difference between revisions

m
imported>Arakov
 
(4 intermediate revisions by 4 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 2,280 ⟶ 2,300:
O'Horse'
e'She''s dead, of course!'</syntaxhighlight>
 
<pre style="height: 10em; overflow-y: scroll"> T
I know an old lady who swallowed a fly.
I don't know why she swallowed the fly.
Perhaps she'll die.
 
I know an old lady who swallowed a spider.
That wriggled and jiggled and tickled inside her.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly.
Perhaps she'll die.
 
I know an old lady who swallowed a Bird.
Quite absurd. To swallow a Bird.
She swallowed the Bird to catch the spider.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly.
Perhaps she'll die.
 
I know an old lady who swallowed a Cat.
Fancy that. To swallow a Cat.
She swallowed the Cat to catch the Bird.
She swallowed the Bird to catch the spider.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly.
Perhaps she'll die.
 
I know an old lady who swallowed a Dog.
What a hog. To swallow a Dog.
She swallowed the Dog to catch the Cat.
She swallowed the Cat to catch the Bird.
She swallowed the Bird to catch the spider.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly.
Perhaps she'll die.
 
I know an old lady who swallowed a Pig.
Her mouth was so big. To swallow a Pig.
She swallowed the Pig to catch the Dog.
She swallowed the Dog to catch the Cat.
She swallowed the Cat to catch the Bird.
She swallowed the Bird to catch the spider.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly.
Perhaps she'll die.
 
I know an old lady who swallowed a Goat.
She just opened her throat. To swallow a Goat.
She swallowed the Goat to catch the Pig.
She swallowed the Pig to catch the Dog.
She swallowed the Dog to catch the Cat.
She swallowed the Cat to catch the Bird.
She swallowed the Bird to catch the spider.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly.
Perhaps she'll die.
 
I know an old lady who swallowed a Cow.
I don't know how. To swallow a Cow.
She swallowed the Cow to catch the Goat.
She swallowed the Goat to catch the Pig.
She swallowed the Pig to catch the Dog.
She swallowed the Dog to catch the Cat.
She swallowed the Cat to catch the Bird.
She swallowed the Bird to catch the spider.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly.
Perhaps she'll die.
 
I know an old lady who swallowed a Donkey.
It was rather wonky. To swallow a Donkey.
She swallowed the Donkey to catch the Cow.
She swallowed the Cow to catch the Goat.
She swallowed the Goat to catch the Pig.
She swallowed the Pig to catch the Dog.
She swallowed the Dog to catch the Cat.
She swallowed the Cat to catch the Bird.
She swallowed the Bird to catch the spider.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly.
Perhaps she'll die.
 
I know an old lady who swallowed a Horse.
She's dead, of course!</pre>
 
=={{header|Java}}==
Line 3,789 ⟶ 3,893:
("IK" "I know an old lady who swallowed a") ("SW" "She swallowed the")
("SS" "she swallowed") ("CA" "to catch the") ("XX" "Perhaps she'll die")
("C" "cow") ("G" "goat") ("D" "dog") ("T@" "cat") ("R" "bird")
("S $" "spider ") ("F" "fly"))
@(bind lastverse
("IK C"
Line 3,796 ⟶ 3,900:
"SW C CA G"
"SW G CA D"
"SW D CA T@"
"SW T@ CA R"
"SW R CA S$"
"SW S$ CA F"
"But I don't know why SS that F"
"XX"
Line 3,808 ⟶ 3,912:
("G: Opened her throat and down went the G!"
"D: What a hog to swallow a D!"
"T@: Imagine that! She swallowed a T@!"
"R: How absurd to swallow a R!"
"S$: That wriggled and jiggled and tickled inside her"
"F: But I don't know why SS the F"))
@(define expand_backwards (song lengthened_song done))
Line 4,054 ⟶ 4,158:
=={{header|Wren}}==
{{trans|Kotlin}}
<syntaxhighlight lang="ecmascriptwren">var animals = ["fly", "spider", "bird", "cat","dog", "goat", "cow", "horse"]
 
var phrases = [
Anonymous user