Jump to content

Old lady swallowed a fly: Difference between revisions

(→‎{{header|Java}}: use template)
Line 1,053:
,"cat.\t\nImagine that. She swallowed a cat."
,"dog.\t\nWhat a hog to swallow a dog."
,"goat.\t\nShe just opened her throat and swallowed thatthe goat."
,"cow.\nI don't know how she swallowed thatthe cow."
,"horse.\nShe's dead, of course."]
 
beginnings = map ("There was an old lady who swallowed a "++) animals
swalloedlastVerse x= yreverse =$ ["She swallowed the "++takeWhile (/='.') y++" to catch the "++ takeWhile (/='\t') x
| (x:y:_:_)<-tails animals]
lastVerse = tail $ reverse $ zipWith swalloed animals $ tail animals
main = putStr $ concatMap unlines $ zipWith (:) beginnings $ cyclereverse $ reverse([]:) $ tails $ lastVerse</lang>
{{out}}<pre>There was an old lady who swallowed a fly.
I don't know why she swallowed a fly.
Cookies help us deliver our services. By using our services, you agree to our use of cookies.