48
5
Whilst trying (and failing) have persuade my infant son to eat his dinner, I tried singing to him. Mid way through this song I realised the formulaic structure might lend itself well to code golfing!
The task is to write a program or function which accepts no input and produces the following text:
There's a hole in the bottom of the sea
There's a hole in the bottom of the sea
There's a hole, there's a hole
There's a hole in the bottom of the sea
There's a log in the hole in the bottom of the sea
There's a log in the hole in the bottom of the sea
There's a hole, there's a hole
There's a hole in the bottom of the sea
There's a bump on the log in the hole in the bottom of the sea
There's a bump on the log in the hole in the bottom of the sea
There's a hole, there's a hole
There's a hole in the bottom of the sea
There's a frog on the bump on the log in the hole in the bottom of the sea
There's a frog on the bump on the log in the hole in the bottom of the sea
There's a hole, there's a hole
There's a hole in the bottom of the sea
There's a wart on the frog on the bump on the log in the hole in the bottom of the sea
There's a wart on the frog on the bump on the log in the hole in the bottom of the sea
There's a hole, there's a hole
There's a hole in the bottom of the sea
There's a hair on the wart on the frog on the bump on the log in the hole in the bottom of the sea
There's a hair on the wart on the frog on the bump on the log in the hole in the bottom of the sea
There's a hole, there's a hole
There's a hole in the bottom of the sea
There's a fly on the hair on the wart on the frog on the bump on the log in the hole in the bottom of the sea
There's a fly on the hair on the wart on the frog on the bump on the log in the hole in the bottom of the sea
There's a hole, there's a hole
There's a hole in the bottom of the sea
There's a flea on the fly on the hair on the wart on the frog on the bump on the log in the hole in the bottom of the sea
There's a flea on the fly on the hair on the wart on the frog on the bump on the log in the hole in the bottom of the sea
There's a hole, there's a hole
There's a hole in the bottom of the sea
There's a smile on the flea on the fly on the hair on the wart on the frog on the bump on the log in the hole in the bottom of the sea
There's a smile on the flea on the fly on the hair on the wart on the frog on the bump on the log in the hole in the bottom of the sea
There's a hole, there's a hole
There's a hole in the bottom of the sea
Challenge rules:
- The text may be printed or returned as function output
- Each verse is separated by a single empty line
- Trailing whitespace is OK as long as it does not change the layout (so no leading whitespace or extra spaces between words)
- Trailing newlines are OK too.
- No leading newlines.
- All languages welcomed, and this is code-golf, so the shortest answer in bytes for each language wins!
6
Similar to There Was an Old Lady (other similar challenges e.g. this have been closed as duplicates, although I don't think they necessarily should.)
– Jonathan Allan – 2019-01-30T16:33:09.5836Ho, ro, the rattlin' bog, the bog down in the valley-o. – fəˈnɛtɪk – 2019-01-30T22:22:57.310
4For comparison (though not a programming language)
gzip -5
compresses it to 186 bytes (andbzip2
andxz
seem to do worse). – Daniel Schepler – 2019-01-30T23:34:48.513@DanielSchepler Bubblegum :P – ASCII-only – 2019-01-31T03:13:40.260
2Congrats, from another developer parent :) – AJFaraday – 2019-01-31T14:26:37.583
1I want to adapt this song to 05AB1E... "There's a hole in oh-five-ay-bee-one-ee!" – Magic Octopus Urn – 2019-01-31T16:40:35.783
As KC string compression challenges go, I've had more fun with this one than most others in a while so
+1
from me. – Shaggy – 2019-02-01T00:06:16.200@Shaggy Thanks for the lovely comment, I'm glad to have given you something fun to think about :o) – Sok – 2019-02-01T06:23:00.500
Next time use Maxwell's poem: 2(u) (Under the Sea, Under the Sea)
– Mazura – 2019-02-02T02:23:57.580