Old lady swallowed a fly: Difference between revisions

m
→‎{{header|REXX}}: elided the use of some variables to just use literals, simplified some statements and indentations, added comments.
m (→‎{{header|REXX}}: elided the use of some variables to just use literals, simplified some statements and indentations, added comments.)
Line 1,988:
=={{header|REXX}}==
<lang rexx>/*REXX program displays song lyrics for: "I Know an Old Lady who Swallowed a Fly". */
sw=79 79 /*the width of the terminal screen, -1.*/
I_know@.=; @.1 = "I don't know anwhy old lady whoshe swallowed a fly,"
@ate = 'She swallowed the'; @2catch.2 = "toThat catchwriggled the"and jiggled and tickled inside her."; @.2.0=.
@.13 = "I don't knowHow whyabsurd sheto swallowedswallow a fly,bird!"
@.4 = "Imagine that, to swallow a cat!"
@.2 = "That wriggled and jiggled and tickled inside her." ; @.2.0=.
@.35 = "HowMy, what a absurdhog, to swallow a birddog!"
@.46 = "ImagineJust opened her that,throat toand swallowswallowed a catgoat!"
@.57 = "My,I what awonder hog,how toshe swallowswallowed a dogcow?!"
@.8 = "She's dead, of course!!"
@.6 = "Just opened her throat and swallowed a goat!"
@.7$ = "I'fly wonderspider howbird shecat swalloweddog agoat cow?!" horse'
#= words($) /*#: [↓] number displayof a blank lineanimals to term. be swallowed*/
@.8 = "She's dead, of course!!"
 
$ = 'fly spider bird cat dog goat cow horse' ; #=words($)
do j=1 for #; say
/* [↓] display a blank line to term. */
dosay j=1center('I know foran old lady who swallowed a' #; fauna=word($, j);",", saysw)
say center(I_know fauna',', sw); if j\==1 then say center(@.j, sw)
if j ==# then leave /*Is this the last verse? We're done.*/
do k=j to 2 by -1; km= k-1; ??= word($, km=k-1)','
say center(@ate'She swallowed the' word($, k) "to catch @2catchthe" word($, km)','??, sw)
if @.km.0\=='' then say center(@.km, sw)
end /*k*/ /* [↑] display the lyrics of the song.*/
say center(@.1, sw)
say center("I guess she'll die.", sw)