RosettaCodeData/Task/Old-lady-swallowed-a-fly/FreeBASIC/old-lady-swallowed-a-fly.basic
2023-07-01 13:44:08 -04:00

23 lines
1 KiB
Text

dim as string lyrics(0 to 7, 0 to 1) = {_
{ "fly", "I don't know why she swallowed a fly - Perhaps she'll die!" },_
{ "spider", "That wriggled and jiggled and tickled inside her!" },_
{ "bird", "How absurd to swallow a bird!" },_
{ "cat", "Imagine that! She swallowed a cat!" },_
{ "dog", "What a hog, to swallow a dog!" },_
{ "goat", "She just opened her throat and swallowed a goat!" },_
{ "cow", "I don't know how she swallowed a cow."},_
{ "horse", "She's dead of course!" } }
for verse as ubyte = 0 to 7
for countdown as byte = verse to 0 step -1
if countdown = verse then
print "There was an old lady who swallowed a "; lyrics(verse, 0);"."
print lyrics(verse, 1)
if verse = 7 then end
end if
if countdown > 0 then print "She swallowed the ";lyrics(countdown, 0);_
" to catch the ";lyrics(countdown-1, 0);","
if countdown = 2 or countdown = 1 then print lyrics(countdown-1, 1)
next countdown
print
next verse