Old lady swallowed a fly: Difference between revisions

Add Draco
(→‎{{header|R}}: - added R code)
(Add Draco)
Line 1,379:
}
}</lang>
 
=={{header|Draco}}==
<lang draco>proc nonrec animal(byte n) *char:
case n
incase 0: "fly"
incase 1: "spider"
incase 2: "bird"
incase 3: "cat"
incase 4: "dog"
incase 5: "goat"
incase 6: "cow"
incase 7: "horse"
esac
corp
 
proc nonrec line(byte n) *char:
case n
incase 0: "I don't know why she swallowed that fly,\r\n"
"Perhaps she'll die.\r\n"
incase 1: "That wiggled and jiggled and tickled inside her,"
incase 2: "How absurd to swallow a bird,"
incase 3: "Imagined that, she swallowed a cat,"
incase 4: "What a hog to swallow a dog,"
incase 5: "She just opened her throat and swallowed that goat,"
incase 6: "I don't know how she swallowed that cow,"
incase 7: "She's dead, of course."
esac
corp
 
proc nonrec verse(byte n) void:
byte a;
writeln("There was an old lady who swallowed a ", animal(n), ", ");
writeln(line(n));
if n/=7 then
for a from n downto 1 do
writeln("She swallowed the ", animal(a),
" to catch the ", animal(a-1), ", ");
if a <= 2 then writeln(line(a-1)) fi
od
fi
corp
 
proc nonrec main() void:
byte n;
for n from 0 upto 7 do verse(n) od
corp</lang>
 
=={{header|Elena}}==
2,114

edits