# There's a hole in the bottom of the sea

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.
• All languages welcomed, and this is , so the shortest answer in bytes for each language wins!
• 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 Jan 30 at 16:33
• Ho, ro, the rattlin' bog, the bog down in the valley-o. – fəˈnɛtɪk Jan 30 at 22:22
• For comparison (though not a programming language) gzip -5 compresses it to 186 bytes (and bzip2 and xz seem to do worse). – Daniel Schepler Jan 30 at 23:34
• Congrats, from another developer parent :) – AJFaraday Jan 31 at 14:26
• I want to adapt this song to 05AB1E... "There's a hole in oh-five-ay-bee-one-ee!" – Magic Octopus Urn Jan 31 at 16:40

# Shell, 291 bytes

echo 'smile,flea,fly,hair,wart,frog,bump,log,hole'|awk -F, 'BEGIN{z="here'\''s a ";a="T"z;c=a "hole";b=" in the bottom of the sea"}function f(n){printf a $n;for(j=n+1;j<=NF;j++){printf " on the "$j};print b;}{for(i=NF;i>=1;i--){printf (i<NF)?"\n":"";f(i);f(i);print c", t" z "hole";f(NF)}}'


I'm sure it can be golfed further (definitions of vars & function) ...

# Java (OpenJDK 8), 320 344 bytes

Long but wanted to try with java, no streams and java 8 things.

*Edited to fix some problems.

static String w(){String[]a={"hole","log","bump","frog","wart","hair","fly","flea","smile"};String n="T",m="t",q=" ",t="here's a ",s="bottom of the sea \n",y="in the ",o="on the ",b=t+a[0],f="",v,l="\n",c=y+s,h=a[0]+q+c,z=n+b+", "+m+b+q+l+n+b+q+c;for (int i=0;i<9;i++){v=n+t;for(int j=i;j>0;j--){v+=a[j]+q+(j>1?o:y);}v+=h;f+=v+v+z+l;}return f;}


Try it online!

• there are two problems the spaces before the commas and the uppercase after comma, otherwise you can check translation of my answers 282 bytes – Nahuel Fouilleul Jan 31 at 15:14
• 269 bytes using lambda notation – Nahuel Fouilleul Jan 31 at 15:18
• @Shaggy You are right, it is fixed now :) – Java Gonzar Jan 31 at 17:21
• @NahuelFouilleul 264 bytes – Kevin Cruijssen Feb 1 at 18:47
• 261 bytes – ceilingcat Feb 1 at 23:04

# C# (.NET Core), 315, 320, 290 bytes

EDIT: Forgot to repeat the first line. :C

EDIT2: Thanks to recursive for -30 bytes! Switched to using a .Split() to form the string array and added a really cool switch for flipping between "in" and "on".

s=>{var b="hole/log/bump/frog/wart/hair/fly/flea/smile/here's a / in the bottom of the sea\n".Split('/');string c=b[9]+b[0],t="";for(int k,j=0;j<9;t=""){t+="T"+b[9];for(k=j++;k>-1;k--)t+=b[k]+(k<1?"":" "+"oi"[1/k]+"n the ");t+=b[10];t+=t+"T"+c+", t"+c+"\n"+"T"+c+b[10]+"\n";s+=t;}return s;}


Try it online!

• Unfortunately your answer is currently invalid, as it doesn't repeat the first line of each verse. – Sok Jan 30 at 22:57
• Missed it! Now fixed, ty Sok. – Destroigo Jan 31 at 15:18
• Few tweaks for you: tio.run/##LZAxa8MwEIX3/IpDS2xkR/… – recursive Feb 1 at 0:38
• Really liked the "oi"[1/k] part for switching between on/in. Ty recursive. – Destroigo Feb 1 at 14:30

# ink, 231 229 bytes

LIST W=hole,log,bump,frog,wart,hair,fly,flea,smile
VAR T="here's a "
~temp H=T+"hole"
VAR B="bottom of the sea"
-(i)~W=W((i+1)/2)
T{T}<>
-(k){W} {W-2:o|i}n the <>
~W--
{W:->k}{B}
{i%2:->i}
T{H}, t{H}
T{H} in the {B}
\
{i<17:->i}


Try it online!

• -2 bytes by changing "{T}hole" to T+"hole" and removing a rogue space