Old lady swallowed a fly: Difference between revisions

m
Line 673:
 
=={{header|Elena}}==
ELENA 3.4.x :
<lang elena>import extensions.;
const Creatures = (new string[]{"fly", "spider", "bird", "cat", "dog", "goat", "cow", "horse").};
const Comments = new string[]
{
(
"I don't know why she swallowed that fly"$10"Perhaps she'll die",
"That wiggled and jiggled and tickled inside her",
Line 687:
"I don't know how she swallowed that cow",
"She's dead of course"
};
).
public program()
{
[
for(int i := 0, i < Creatures.Length, i += 1)
0 till(Creatures length) do(:i)
[{
console
.printLineFormatted("There was an old lady who swallowed a {0}",Creatures[i]);
.printLine(Comments[i]).;
if((i != 0) &&( i != Creatures length.Length - 1))
[{
ifor(int j till:= i, j > 0, do(:j -= 1)
[{
console .printLineFormatted("She swallowed the {0} to catch the {1}",Creatures[j],Creatures[j - 1])
].};
console .writeLine(Comments[0])
].};
console .writeLine()
]}
]}</lang>
 
=={{header|Elixir}}==
Anonymous user