| Bytes | Lang | Time | Link |
|---|---|---|---|
| 116 | AWK | 250909T162447Z | xrs |
| 125 | Rockstar | 200925T154450Z | Shaggy |
| 897 | Farm | 190220T002547Z | ბიმო |
| 048 | Vyxal | 210715T101753Z | emanresu |
| 072 | APL Dyalog Unicode | 201213T141516Z | Kamila S |
| 527 | Befunge93 | 200928T154826Z | ATMunn |
| nan | x8616 machine code | 190216T230829Z | 640KB |
| 110 | ink | 190722T003727Z | Sara J |
| nan | Wren | 200123T053617Z | user8505 |
| 070 | GolfScript | 191212T214829Z | Pseudo N |
| 121 | Kotlin | 191120T163058Z | JeRoll |
| 038 | 05AB1E | 190722T111445Z | Grimmy |
| 2866 | Babylang | 191120T103844Z | user8505 |
| 089 | Underload | 190722T102158Z | Edgex42 |
| 065 | Emotion | 190321T212257Z | Quantum6 |
| 126 | JavaScript | 190218T161807Z | Aldemaro |
| 095 | Wolfram Language Mathematica | 190224T025317Z | ASCII-on |
| 042 | Jelly | 190223T220124Z | Jonathan |
| nan | Javascript | 190221T110637Z | Coert Gr |
| 120 | R | 190218T172918Z | Sumner18 |
| 122 | C gcc | 190216T114758Z | gastropn |
| 057 | Japt R | 190221T153634Z | Oliver |
| 147 | PHP | 190218T151151Z | EvanBarb |
| 147 | Plain TeX | 190221T124644Z | Chris H |
| nan | Emojicode | 190217T095515Z | txtechhe |
| 076 | PowerShell | 190216T014231Z | GMills |
| 554 | whenyouaccidentallylose100endorsementsinnationstates 98 | 190217T183905Z | MilkyWay |
| 573 | brainfuck | 190219T175534Z | Sasha |
| 151 | TSQL | 190219T231820Z | BradC |
| 149 | Swift 4 | 190219T204955Z | thachnb |
| 096 | groovy | 190219T155718Z | Matias B |
| 139 | C# Visual C# Interactive Compiler | 190219T190530Z | Thymine |
| 137 | R | 190218T230358Z | Chthonyx |
| 125 | R | 190219T111310Z | BobbyBea |
| 131 | C# Visual C# Interactive Compiler | 190216T025707Z | Gymhgy |
| 156 | F# .NET Core | 190219T130744Z | thinkbef |
| 177 | Emacs Lisp | 190219T140643Z | adl |
| 179 | F# .NET Core | 190219T121741Z | aloisdg |
| 145 | Wolfram Language Mathematica | 190219T055232Z | Kai |
| 118 | VBA Excel | 190218T090440Z | remoel |
| 097 | Haskell | 190219T034554Z | xnor |
| 134 | Clean | 190218T221512Z | Οurous |
| 051 | Jelly | 190218T192737Z | hyperneu |
| 104 | PHP | 190218T190112Z | Titus |
| 087 | jq | 190218T165919Z | manatwor |
| 138 | PostgreSQL | 190216T173759Z | Peter Va |
| 104 | Haskell | 190216T213349Z | starsand |
| nan | C compiled with VC++ Visual Studio 2017 536Bytes | 190217T221824Z | der bend |
| 078 | bash | 190217T193433Z | Nahuel F |
| 084 | Perl 5 | 190217T171327Z | Rubio |
| 043 | Stax | 190217T054356Z | recursiv |
| 115 | ><> | 190216T081715Z | DLosc |
| 041 | 05AB1E | 190216T113331Z | Kevin Cr |
| 096 | Python 3 | 190216T015520Z | njha |
| 085 | J | 190216T033727Z | Jonah |
| 104 | JavaScript | 190216T140128Z | Shaggy |
| 040 | SOGL | 190216T123629Z | dzaima |
| 074 | Retina 0.8.2 | 190216T020622Z | Neil |
| 055 | Japt R | 190216T110135Z | Shaggy |
| 082 | Ruby | 190216T105449Z | Kirill L |
| 132 | JavaScript Node.js | 190216T082521Z | Neil A. |
| 135 | Java JDK | 190216T081657Z | Olivier |
| 079 | Attache | 190216T042759Z | Conor O& |
| 124 | /// | 190216T042048Z | Conor O& |
| 089 | cQuents | 190216T025058Z | Stephen |
| 093 | Python 2 | 190216T025025Z | xnor |
| 078 | Perl 6 | 190216T020424Z | Jo King |
AWK, 116 bytes
END{for(s=" Shark";i++<split("Baby Daddy Mommy Grandpa Granma",b);)print(a=(c=b[i]s)(a=" doo")a a a a a RS)a a c"!"}
Rockstar, 151 125 bytes
cut "Baby,Daddy,Mommy,Grandpa,Grandma" in N with ","
while N
roll N in S
let L be S+" Shark"+" doo"*6+"
"
say L*3+S+" Shark!"
Try it here (Code will need to be pasted in)
Farm, 1157 897† bytes
-260 bytes: apparently only cock a doodle doo needs spaces..
No sharks on my farm:
cock a doodle doomoocotmoobzzcoucoumewmewmewmewmewmewmewgobblehihihimoopiuarfarfarfarfarfarfarfrouuuleomoopiumoosquealhihihimewmooleoarfarfarfrouuuleomoomoocotmoopiuarfarfarfmooleoarfarfarfarfmoomoocoucouarfarfarfssscoinsssgruntcoinblatcoinssscoinblatcoinssscoinblatmoosssgruntmooblatarfarfarfarfarfarfsssmoogruntmoogruntmoogruntgruntcoincoincoinmewblatmoosssmooblatmoosssmooblatcoinmewblatcoinsssgruntcoinblatcoinssscoinblatcoinssscoinblatmoosssgruntmooblatcotarfgruntsssmewblatmoosssmooblatmoogobblesquealmewmoopiuarfmoopiumooroararfmooarfarfarfarfarfarfarfarfarfarfmoohihihimooarfarfmooarfarfarfmoopiumoosssmewmooarfcoinblatroararfarfarfmoomoohihihimooleoarfarfrouuuleomooleomooleoarfarfmooarfarfarfarfarfarfarfarfarfmoomoohihihipiumooleoarfarfarfmoopiuarfarfarfmoomewmoopiumooleoarfarfarfarfarfmooroararfarfarfarfarfarfmooarfarfarfarfarfarfarfarfarfarfmoohihihimoomewmewmewsssmooblathihihihowl
†: Could be 9 less by using cocorico over cock a doodle doo..
Vyxal, 48 bytes
`÷Ċ ₈Ȧ Mummy ∆ƛpa ∆ƛma`⌈` Ẏ꘍`+ƛ3(` doo`6*+,)\!+,
A mess.
`...`⌈ # Names, split on newlines
`...`+ # Append ' Shark' to each
ƛ # Foreach...
3( ) # Three times
` doo`6*+, # Append six doos and output
\!+, # Append a ! and output
APL (Dyalog Unicode), 72 bytes (SBCS)
↑,(,∘' Shark'¨'BabyDaddyMommyGrandpaGrandma'(∊⊂⊣)⎕A)∘.,'!',⍨3⍴⊂24⍴' doo'
Explanation:
↑,(,∘' ..'¨'...'(∊⊂⊣)⎕A)∘.,'!',⍨3⍴⊂24⍴' doo'
24⍴' doo'⍝ repeat 'doo' 6 times
⊂ ⍝ box the 'doo's
3⍴ ⍝ make three copies
'!',⍨ ⍝ append a `!` at the end
'...'(∊⊂⊣)⎕A ⍝ split the long string on capitals
,∘' ..'¨ ⍝ append to all family members
∘., ⍝ construct a table where each row is
⍝ a full verse of the song
↑, ⍝ flatten the resulting verse table
-28 thanks to @Adám
-2 bytes (-14 before; but I did a few golfs before checking the golfed version) thanks to @Razetime
Befunge-93, 527 bytes
vv <<
3v v,< v v v
0>" ybaB">:| p
<v <^6#
v,< 1
>>"krahS">:| "
v06$ <0<v,,"!"*25
v,<>^"$v <
>"ood ">:|^_^3 v,<
^0_v#:-1$< : \>" yddaD">:|
^ >$52*,1-^ "^0$ < >
^ v v < v,<>
>">":62*1p62*#"1+1p^>" ymmoM">:|
^p-1:*27"1"p61< 0 > >^
v p1-1*46">"p6< $ v <v,<
>"6"72*:p #p ^ >"dnarG">:|
v p1*39">"< ^ ,,,"pa "<
>"v"72*82*p >$0^
v p*28*48"m"<
>"@"72*6p ^
I didn't really try to golf it much, I just wanted it to work. It does, and I'm pretty proud of it. I used the "p" command heavily to reuse a lot of code.
x86-16 machine code, IBM PC DOS, 108 107 bytes
00000000: bd42 01e8 1600 bd47 01e8 1000 bd4d 01e8 .B.....G.....M..
00000010: 0a00 bd53 01e8 0400 c646 056d b409 b104 ...S.....F.m....
00000020: 8bd5 cd21 ba5b 01cd 21e2 06ba 6701 cd21 ...!.[..!...g..!
00000030: c3b3 06ba 6201 cd21 4b75 fbba 6801 cd21 ....b..!Ku..h..!
00000040: ebde 4261 6279 2444 6164 6479 244d 6f6d ..Baby$Daddy$Mom
00000050: 6d79 2447 7261 6e64 7061 2420 5368 6172 my$Grandpa$ Shar
00000060: 6b24 2064 6f6f 2421 0d0a 24 k$ doo$!..$
Unassembled:
BD 0142 MOV BP, OFFSET BABY ; Baby Shark
E8 011C CALL VERSE
BD 0147 MOV BP, OFFSET DADDY ; Daddy Shark
E8 011C CALL VERSE
BD 014D MOV BP, OFFSET MOMMY ; Mommy Shark
E8 011C CALL VERSE
BD 0153 MOV BP, OFFSET GRAND ; Grandpa/ma Shark
E8 011C CALL VERSE
C6 46 05 6D MOV BYTE PTR [BP][5], 'm' ; change 'p' to 'm'
VERSE:
B4 09 MOV AH, 9 ; DOS API display string function
B1 04 MOV CL, 4 ; loop verse counter
LOOP_VERSE:
8B D5 MOV DX, BP ; load shark name from BP
CD 21 INT 21H ; display shark name
BA 015B MOV DX, OFFSET SHARK ; load 'Shark'
CD 21 INT 21H ; display 'Shark'
E2 06 LOOP LOOP_DOO ; if not last line, write 'doo's
BA 0167 MOV DX, OFFSET BANG ; otherwise end with a bang
CD 21 INT 21H ; display !, CRLF
C3 RET ; return from CALL or to DOS
LOOP_DOO:
B3 06 MOV BL, 6 ; loop 'doo' 6 times
BA 0162 MOV DX, OFFSET DOO ; load 'doo' string
PRINT_DOO:
CD 21 INT 21H ; display 'doo'
4B DEC BX ; decrement doo count
75 FB JNZ PRINT_DOO ; if not last doo, start again
BA 0168 MOV DX, OFFSET CRLF ; load CRLF string
CD 21 INT 21H ; display CRLF
EB DE JMP LOOP_VERSE ; repeat verse
BABY DB 'Baby$'
DADDY DB 'Daddy$'
MOMMY DB 'Mommy$'
GRAND DB 'Grand'
PA DB 'pa$'
SHARK DB ' Shark$'
DOO DB ' doo$'
BANG DB '!'
CRLF DB 0DH,0AH,'$'
Output
(TODO: update this screenshot for one less byte...)
ink, 114 113 110 bytes
-(h)~temp t="{Baby|Daddy|Mommy|Grand{ma|pa}} Shark"
-(l){t}<>{l%4<1:
!
{h>5:->END}->h
}
-(d)\ doo{d%5:->d}
->l
Explained
-(h) // A gather, we can jump here and keep track of how many times we've visited.
~temp t="{Baby|Daddy|Mommy|Grand{ma|pa}} Shark" // The sequence takes on the next value each time it's visited, and we can nest them. Save into local variable t
-(l){t}<>{l%4<1: // Print t and no newline, then if the number of times we've been here is divisible by 4...
! // Print an exclamation mark
{h>5:->END}->h // Go to h, or halt if we've already been there more than 5 times
}
-(d)\ doo{d%5:->d} // Print " doo" until we've done it a number of times that is a multiple of 5
->l // Go to l to print the next line
Wren, 110 108 bytes
Fn.new{["Baby","Daddy","Mommy","Grandpa","Grandma"].map{|i|((i=i+" Shark")+" doo"*6+"
")*3+i+"!"}.join("
")}
GolfScript, 70 bytes
"Baby
Daddy
Mommy
Grandpa
Grandma"n/{" Shark"+" doo"6*n++...-25<"!"n}/
Explanation:
"Baby
Daddy
Mommy
Grandpa
Grandma"n/ Push shark names, then split by newline
{ }/ For each name:
" Shark"+ Concatenate with Shark
" doo"6*n++ add doo * 6 then newline
... Duplicate line 3 more times
-25< Cut off the "doo"s
"!"n Add "!"
Kotlin 121 bytes
"Baby Daddy Mommy Grandpa Grandma".split(" ").map{(println(("${"$it Shark${" doo".repeat(6)}\n".repeat(3)}$it Shark!")))}
05AB1E, 39 38 bytes
”‡ÍÊТ×myîºpaîºma”#„o€·À6×3и'!ª”㢔ìâ»
”‡ÍÊТ×myîºpaîºma” # compressed string "Baby Daddy Mommy Grandpa Grandma"
# # split on spaces
„o€· # dictionary string "o do"
À # rotated left: " doo"
6× # string-repeat 6 times: " doo doo doo doo doo doo"
3и # list-repeat 3 times
'!ª # append "!" to that list
”㢔ì # prepend "Shark" to each element of that list
â # cartesian product
» # join by newlines
# implicit output
Babylang, 2866 bytes
aaag aaag gagu aaag aaag aaag aaag aaag aaag aaag aaag aaag aaag aaag aaag aaag aaag aaag aaag aaag aaag gaga gaga gaga aaag gaga gaga aaag aaag aaag aaag aaag gaga gaga aaag aaag aaag aaag aaag gaga gaga uuug uuug gaga gaga gaga gaga aaag gaga gaga aaag aaag aaag aaag aaag gaga gaga aaag aaag aaag aaag aaag gaga gaga aaag aaag aaag aaag aaag gaga gaga uuug uuug gaga gaga gaga gaga aaag gaga gaga uuug uuug gaga gaga uuug uuug gaga gaga uuug uuug gaga gaga uuug uuug gaga gaga gaga gaga aaag gaga gaga uuug uuug gaga gaga aaag aaag aaag aaag aaag gaga gaga uuug uuug gaga gaga aaag aaag aaag aaag aaag gaga gaga uuug uuug gaga gaga aaag aaag aaag aaag aaag gaga gaga gaga gaga aaag gaga gaga uuug uuug gaga gaga aaag aaag aaag aaag aaag gaga gaga uuug uuug gaga gaga aaag aaag aaag aaag aaag gaga gaga uuug uuug gaga gaga aaag aaag aaag aaag aaag gagu gagu gugu gugu guga gugu gugu guga gaga guga gaga gaga gaga uuug uuug uuug uuug gaga gaga uuug gaga gaga gaga gaga aaag aaag aaag aaag aaag aaag aaag aaag gaga gaga aaag gaga gaga uuug uuug gaga gaga uuug gaga gaga aaag aaag gaga gaga aaag aaag gaga gaga aaag aaag aaag aaag aaag aaag aaag aaag gaga gaga aaag gaga gaga aaag aaag aaag aaag aaag aaag aaag gaga gaga uuug uuug gaga gaga uuug uuug uuug uuug gaga gaga uuug uuug uuug uuug gaga gaga aaag aaag aaag aaag aaag aaag aaag aaag gaga gaga aaag gaga gaga aaag gaga gaga aaag gaga gaga uuug gaga gaga uuug uuug uuug gaga gaga aaag aaag gaga gaga uuug gaga gaga uuug gaga gaga aaag gaga gaga aaag gaga gaga aaag gaga gaga uuug gaga gaga uuug uuug uuug gaga gaga aaag aaag gaga gaga uuug uuug uuug uuug gaga gaga uuug gagu uuug gugu aaag gugu guga gaga gagu gaga gaga guga aaag gaga gaga gaga aaag aaag aaag aaag aaag aaag aaag aaag aaag aaag aaag gagu aaag aaag aaag aaag aaag aaag aaag gaga uuug uuug uuug uuug uuug uuug uuug gaga aaag gaga gaga aaag gaga uuug uuug uuug uuug uuug gaga aaag aaag aaag gaga aaag aaag aaag gaga uuug uuug uuug uuug gaga aaag aaag aaag gugu gugu gugu gugu gugu gugu gugu gugu gugu guga gaga uuug gaga uuug uuug gaga gaga uuug uuug uuug gaga aaag aaag gaga uuug gaga uuug uuug uuug uuug uuug uuug uuug uuug gaga uuug uuug gaga aaag aaag gagu gugu guga gugu gugu gugu gugu gugu gugu gagu gaga gaga gaga aaag aaag aaag gagu uuug gugu gugu gugu gagu gugu gugu guga gaga gaga gaga gagu guuu gaga gaga guga gaga gagu gaga gaga guga gaga gaga gaga gaga gaga gagu guuu gaga guga gugu gagu gugu guga aaag aaag aaag aaag aaag aaag gagu uuug gaga guuu gaga gaga gaga aaag aaag aaag guuu uuug uuug uuug gaga uuug uuug uuug guuu guuu aaag aaag aaag gugu gugu gugu gugu gugu guga gugu gugu guuu gugu guga gugu gugu gugu gagu gugu gugu guga gaga gaga uuug gaga gagu guuu gagu uuug guga gaga uuug gaga guga gaga gagu gaga gaga guga gaga gaga gaga gaga gaga gagu guuu gaga guga gugu gagu gugu guga gugu guuu gugu guuu gugu gugu gugu gugu guga
Underload, 93 89 bytes
(Grandma)(Grandpa)(Mommy)(Daddy)(Baby)(~( Shark)*:( doo)::**:**(
)*::**S(!
)*S):^:^:^:^:^
Since Underload is really good at duplicating and concatenation with strings, I decided to give this a go.
Saved 4 bytes by re-arranging things.
Explanation
(Grandma) Pushes 'Grandma'
(Grandpa) Pushes 'Grandpa'
(Mommy) Pushes 'Mommy'
(Daddy) Pushes 'Daddy'
(Baby) Pushes 'Baby'
( Add the next bit of code to the stack
~ Swaps so the name of the Shark (eg: Baby) is on the top of the stack
( Shark) Pushes ' Shark' to the stack
* Concatenates ' Shark' to the name of the Shark
: Duplicates the top of the stack
( doo) Pushes ' doo'
::**:* Turns it into ' doo doo doo doo doo doo'
* Concatenates it to the '[name] Shark'
(<Newline>)* Concatenates a newline to the string, making it '[Name] Shark doo doo doo doo doo doo[Newline]'
::** Duplicates it twice
S Outputs the first three lines of the stanza
(![Newline])*S Concatenates '![Newline]' to the '[Name] Shark' string and prints it
) Ends the code being added to the stack
:^:^:^:^: Runs the code in the bracket 5 times, for the 5 different stanzas
Emotion, 65 bytes
😇😃😟🥕😤😦😇😅🧖💥😛🥒🥥🧖😨🤕😇😁💟😫😳🤠😇😆💟😫😳🌽🍌😘😁🚵😙🚵💥😘😁🧟👍🧟💥🚣❤🤣🏃😢🤯😒😁😵😔😧🧐🤠😇😅🧖💥😛🥒🥥🧗😧🧐🤠
Explanation
😇😃😟🥕 Push literal doo
😤 Push five copies of the first stack value.
😦 Collapse all stack values into a string seperated by spaces, then push that string.
😇😅🧖💥😛🥒🥥🧖 Push literal Shark
😨 Push the difference of the second and first stack values.
🤕 Store the first stack value in the a register.
😇😁💟😫😳🤠 Push literal Grandma
😇😆💟😫😳🌽🍌 Push literal Grandpa
😘😁🚵😙🚵💥 Push literal Mommy
😘😁🧟👍🧟💥 Push literal Daddy
🚣❤ Push literal Baby
🤣 Push literal 6
🏃😢 Push stack values into a list of the size of the first stack value starting with the second stack value.
🤯 Enter an iteration block over the first stack value and push the iteration element register at the begining of each loop.
😒 Push three copies of the first stack value.
😁 Push literal 3
😵 Enter an iteration block over the first stack value.
😔 Push the value contained in the a register.
😧 Push the sum of the second and first stack values.
🧐 Print the first stack value, then a newline.
🤠 Ends a control flow structure.
😇😅🧖💥😛🥒🥥🧗 Push literal Shark!
😧 Push the sum of the second and first stack values.
🧐 Print the first stack value, then a newline.
🤠 Ends a control flow structure.
JavaScript (134 126 bytes)
-2 bytes thanks to Stephen! -6 bytes thanks to mgthomas99!
["Baby","Daddy","Mommy","Grandma","Grandpa"].forEach(a=>console.log((a+" shark"+" doo".repeat(6)+"\n").repeat(3)+a+" Shark!"))
Wolfram Language (Mathematica), 95 bytes
Do[Print[a," Shark"<>If[i>3,"!",Table[" doo",6]]],{a,{Baby,Daddy,Mommy,Grandpa,Grandma}},{i,4}]
Jelly, 42 bytes
“¡N³»ẋ6Wẋ3;”!ṭ€;Y
“¡ʂɓṙṢ®ÑR+£ṭỤṙ»Ḳ瀓¤⁾ċ»Y
How?
“¡N³»ẋ6Wẋ3;”!ṭ€;Y - Link 1: make a verse: familyMember; space+animalName
- e.g. "Baby"; " Shark"
“¡N³» - dictionary word " doo"
ẋ6 - repeat 6 times -> " doo doo doo doo doo doo"
W - wrap in a list -> [" doo d..."]
ẋ3 - repeat 3 times -> [" doo d..."," doo d..."," doo d..."]
”! - literal '!' character
; - concatenate -> [" doo d..."," doo d..."," doo d...","!"]
; - concatenate inputs ["Baby Shark"]
ṭ€ - tack for €ach -> [["Baby Shark"," doo d..."],...,["Baby Shark","!"]]
Y - join with newline characters
“¡ʂɓṙṢ®ÑR+£ṭỤṙ»Ḳ瀓¤⁾ċ»Y - Main Link: no arguments
“¡ʂɓṙṢ®ÑR+£ṭỤṙ» - dictionary words "Baby"+" Daddy"+" Mommy"+" Grandpa"+" Grandma"
Ḳ - split at spaces -> ["Baby","Daddy","Mommy","Grandpa","Grandma"]
“¤⁾ċ» - dictionary word " Shark"
ç€ - call last Link (1) as a dyad for €ach
Y - join with newline characters
- implicit print
Javascript, 125 123 bytes
['Baby','Daddy','Mommy','Grandpa','Grandma'].flatMap(x=>[...[,,,].fill(' doo'.repeat(6)),'!'].map(y=>x+' Shark'+y)).join`
`
R, 131 122 120 bytes
-9 bytes thanks to Giuseppe
-2 more bytes, also Giuseppe
`?`=c
s="Shark"
for(x in "Baby"?"Daddy"?"Mommy"?"Grandpa"?"Grandma")cat(rep("
"?x?s?rep("doo",6),3)?"
"?x?paste0(s,"!"))
Quite proud of this actually, especially with R being rather poor at handling strings. I started out using cat(sapply(...)), but realized a for loop shaves off a few bytes.
Abusing the "?"=c significantly reduced the amount of parentheses needed.
I also tried to do "*"=rep to repeat the individual lines of the stanzas and the "doos", but that did not shave off any bytes.
111 bytes
Giuseppe and ASCII-only's alternative, (and better) solution that fixes some spacing issues.
write(paste0(rep(c("Baby","Daddy","Mommy","Grandpa","Grandma"),,,4)," Shark",c(rep(strrep(" doo",6),3),"!")),1)
C (gcc), 123 122 bytes
-1 byte thanks to ceilingcat
#define A" doo doo"
f(i){for(i=20;i--;)printf("%.7s Shark%s\n","GrandmaGrandpaMommy\0 Daddy\0 Baby"+i/4*7,i%4?A A A:"!");}
PHP, 153 147 bytes
<?php $s='Shark';$d=str_pad('',23,'doo ');foreach(explode(' ','Baby Daddy Mommy Grandpa Grandma')as$a){echo str_repeat("$a $s $d\n",3),"$a $s!\n";}
Thanks to @manatwork for saving 6 bytes by pointing out str_pad('',23'doo '); is shorter than rtrim(str_repeat('doo ',6));
Plain TeX, 147 Bytes
\input pgffor\def\D{doo~}\def\d{\D\D\D\D\D\D}\def\S{Shark}\def\y{\x~\S~\d\par}\foreach\x in{Baby,Mommy,Daddy,Grandma,Grandpa}{\y\y\y\x~\S!\par}\bye
Rather disappointing, but I haven't posted a TeX answer in ages. Loops are very verbose in teX (and looping over strings isn't even built-in so even this is a bit of a stretch)
Emojicode, 292 bytes (140 characters)
🏁🍇🔤Baby🔤➡️b🔤Daddy🔤➡️y🔤Mommy🔤➡️o🔤Grandpa🔤➡️g🔤Grandma🔤➡️a🔤 Shark🔤➡️s🔤 doo🔤➡️d🍨b y o g a🍆➡️f🔂m f🍇🔂i🆕⏩⏩0 3❗️🍇😀🍪m s d d d d d d🍪️❗️🍉😀🍪m s🔤!🔤🍪❗️🍉🍉
Expanded out:
🏁🍇
🔤Baby🔤 ➡️ b
🔤Daddy🔤 ➡️ y
🔤Mommy🔤 ➡️ o
🔤Grandpa🔤 ➡️ g
🔤Grandma🔤 ➡️ a
🔤 Shark🔤 ➡️ s
🔤 doo🔤 ➡️ d
🍨b y o g a🍆➡️f
🔂m f🍇
🔂i🆕⏩⏩0 3❗️🍇
😀🍪m s d d d d d d🍪️❗️
🍉
😀🍪m s🔤!🔤🍪❗️
🍉
🍉
Explained (per the Emojicode doc):
🍇🍉
The same as a { and } (e.g. a code block)
🏁
The "program start" (e.g. int main())
🔤Baby🔤 ➡️ b
Variable assignment (e.g. const char* b = "Baby";)
🍨b y o g a🍆➡️f
Says, create a list of values between 🍨 and 🍆 and assign (➡️) to f (e.g. const char* f[] = {b,y,o,g,a};)
🔂m f🍇 ... 🍉
This line says to loop over the elements in f using the alias m, where the ... is the code between 🍇 and 🍉.
🔂 i 🆕⏩⏩ 0 3❗️🍇 ... 🍉
This line says to loop over the range [0,3), where the ... is the code between 🍇 and 🍉.
😀🍪 ... 🍪️❗️
This line says to print the format specified in ... (e.g. printf("%s\n");)
The code translated to C:
#include <stdio.h>
int main() {
const char* b = "Baby";
const char* y = "Daddy";
const char* o = "Mommy";
const char* g = "Grandpa";
const char* a = "Grandma";
const char* s = " Shark";
const char* d = " doo";
const char* f[] = {b,y,o,g,a};
int m = 0, i = 0;
for (; m < 5; ++m) {
for (i = 0; i < 3; ++i) {
printf("%s%s%s%s%s%s%s%s\n", f[m], s, d, d, d, d, d, d);
}
printf("%s%s!\n", f[m], s);
}
return 0;
}
Following this, the original code (posted below for posterity) had some issues; mostly that the 🏁🍇🍉 block was not included for those who wish to run it, and the emoji's were not actually properly escaped, to that, here is the actual running version of that code:
Original modified to run: Emojicode, 224 bytes (67 characters)
🏁🍇🍨🔤👶🔤🔤👨🔤🔤🤱🔤🔤👴🔤🔤👵🔤🍆➡️f🔂m f🍇🔂i🆕⏩⏩0 3❗️🍇😀🍪m🔤🦈💩💩💩💩💩💩🔤🍪️❗️🍉😀🍪m🔤🦈!🔤🍪❗️🍉🍉
Expanded out:
🏁🍇
🍨
🔤👶🔤
🔤👨🔤
🔤🤱🔤
🔤👴🔤
🔤👵🔤
🍆 ➡️ f
🔂 m f 🍇
🔂 i 🆕⏩⏩ 0 3❗️🍇
😀🍪m🔤🦈💩💩💩💩💩💩🔤🍪️❗️
🍉
😀🍪m🔤🦈!🔤🍪❗️
🍉
🍉
Which produces the output:
👶🦈💩💩💩💩💩💩
👶🦈💩💩💩💩💩💩
👶🦈💩💩💩💩💩💩
👶🦈!
👨🦈💩💩💩💩💩💩
👨🦈💩💩💩💩💩💩
👨🦈💩💩💩💩💩💩
👨🦈!
🤱🦈💩💩💩💩💩💩
🤱🦈💩💩💩💩💩💩
🤱🦈💩💩💩💩💩💩
🤱🦈!
👴🦈💩💩💩💩💩💩
👴🦈💩💩💩💩💩💩
👴🦈💩💩💩💩💩💩
👴🦈!
👵🦈💩💩💩💩💩💩
👵🦈💩💩💩💩💩💩
👵🦈💩💩💩💩💩💩
👵🦈!
Where in you have the individual emoji's representing the words:
👶 -> Baby
👨 -> Daddy
🤱 -> Mommy
👴 -> Grandpa
👵 -> Grandma
🦈 -> Shark
💩 -> doo
Original: Emojicode, 138 bytes (47 characters)
🍨👶👨🤱👴👵🍆➡️f🔂m f🍇🔂i🆕⏩⏩0 3❗️🍇😀m🦈💩💩💩💩💩💩❗️🍉😀m🦈!❗️🍉
Expanded out:
🍨👶👨🤱👴👵🍆➡️f
🔂m f🍇
🔂 i 🆕⏩⏩ 0 3❗️🍇
😀 m 🦈💩💩💩💩💩💩❗️
🍉
😀 m 🦈!❗️
🍉
PowerShell, 88 86 85 80 79 76 bytes
-5 bytes thanks to @mazzy
-1 byte thanks to @Joey
-3 bytes thanks to @AdmBorkBork
echo Baby Daddy Mommy Grandpa Grandma|%{,(($a="$_ Shark")+" doo"*6)*3;"$a!"}
We've certainly come a long way.
PowerShell (with Text to Speech), 156 bytes
This is NOT up to spec, but it's kinda funny. Thanks to @rkeet for the idea!
Add-Type -a System.Speech;echo Baby Daddy Mommy Grandpa Grandma|%{(New-Object Speech.Synthesis.SpeechSynthesizer).Speak((($a="$_ Shark")+" doo"*6)*3+" $a")}
.NET Text to speech pronunciation is... well... interesting. Keep this in mind when listening. Enjoy!
whenyouaccidentallylose100endorsementsinnationstates - 123,065 121,716 113,695 100,889 98,554 bytes
I'll golf this later. Done.
I'll golf this more (later) Done.
I'll golf this even more later. DONE.
I'll get the byte count to 5 digits later. YAY.
I'll get the byte count to 4 digits (I don't know if this is possible, but I do know it is impossible to get 3 digits with my current approach).
brainfuck, 627 593 573 bytes
Initialise Array with "Baby\0Daddy\0Mommy\0Grandpa\0Grandma"
Loop runs 71 times
++[++++++++++++++++++
Get array cells to approximately correct values
>>>+>>+++++>>+++++>>-->>>>+>>+++++>>+++++>>+++++>>-->>>>+>>-->>-->>-->>-->>>>+>>-->>+++++>>-->>+++++>>-->>+++++>>>>+>>-->>+++++>>-->>+++++>>-->>+++++
[[<<]<<]>
]
Finish getting cells to correct values
>>>---->>->>>>++++++++>>+>>-->>->>++>>++>>++++++++>>+>>+++++++>>-->>---->>---->>++++++++>>+>>+>>+>>->>--->>++>>->>->>+>>+>>+>>->>--->>++>>---->>-
Inject ones between each cell in the array
[-<+<]>[>>]+
Initialise an exclamation mark; newline; and the string " Shark"
>>>+++++++++++[+++++++
>------->+>>+>----->+++>+++>---->+++
<<<<<<<<<
]
>->-->>--->++>->-------->-->++
[<]
Go to the end of the "Baby" Array to loop
<<<<<<[
>>>
Loop 3 times
+++[-
Go to the first value of the baby array
<<<[<<]>>>
Print the word out
[.>>]
Go to the shark array
>[>>]>>>>>
Print " Shark"
[.>]
<[<]
Loop 6 times
++++++[-
Print a space
>.
Change the 'a' in " Shark" to a 'd' and print
>>>+++.---
Change the 'r' in " Shark" to an 'o' and print twice
>---..+++
<<<<<
]
Print newline
<<.
<
]
Go to start of baby array
<<<[<<]>>
Print and consume the first string in the array
->[.[-]>->]
Go to shark string
>[>>]>>>>>
Print " Shark"
[.>]
<[<]
Print "!\n"
<.<.
<<<<
]
-20B thanks to Jo King
T-SQL, 151 bytes
SELECT REPLACE(a.value+' Shark'+b.value,'Q',REPLICATE(' doo',6))
FROM STRING_SPLIT('Baby,Daddy,Mommy,Grandpa,Grandma',',')a,STRING_SPLIT('Q,Q,Q,!',',')b
Line break for readability only.
SQL's built-in function names are annoyingly long.
STRING_SPLIT works in SQL 2016 and later.
Order isn't 100% guaranteed without an ORDER BY, but this seemed to work in my testing.
Swift 4, 149 bytes
var s=" Shark";for i in["Baby","Daddy","Mommy","Grandpa","Grandma"]{for _ in 0...2{print(i+s+(0..<6).map({_ in" doo"}).reduce("",+))};print(i+s+"!")}
groovy, 96 bytes
'Baby Daddy Mommy Grandpa Grandma'.split().any{n="$it Shark";println((n+" doo"*6+'\n')*3+n+'!')}
C# (Visual C# Interactive Compiler), 139 bytes
"Baby Daddy Mommy Grandpa Grandma".Split().ToList().ForEach(x=>{string a=" doo",m=x+$" Shark{a+a+a+a+a+a}\n";Write(m+m+m+x+" Shark!\n");});
Any thoughts on improvements? I started aiming for a Linq-based solution with a SelectMany but the deferred execution failed me, along with string.join and return x; being quite verbose syntax
R, 139 138 137 bytes
s='Shark';d='doo';cat(paste(rep(c('Baby','Daddy','Mommy','Grandpa','Grandma'),e=4),c(rep(paste(s,d,d,d,d,d,d),3),paste0(s,'!'))),sep='
')
There's probably a better way to do the 'doo's but I wasn't able to get it.
Edit:
Replaced '\n' with actual new line at JDL's suggestion;
Removed trailing newline at Giuseppe's suggestion.
R, 126 125 bytes
cat(paste(rep(c("Baby","Daddy","Mommy","Grandpa","Grandma"),,,4),c(rep("Shark doo doo doo doo doo doo",3),"Shark!")),sep="
")
This doesn't feel as 'clever' as either CT Hall or Sumner18's answers, but by avoiding the overhead of defining variables it comes out smaller.
Edit: Saved 1 byte by using carriage return as per comment by Jonathan Frech
C# (Visual C# Interactive Compiler), 153 131 bytes
foreach(var i in"Baby Daddy Mommy Grandpa Grandma".Split()){var a=i+" Shark doo doo doo doo doo doo\n";Write(a+a+a+i+" Shark!\n");}
Thanks to @Destrogio for saving 30 bytes!
F# (.NET Core), 160 156 bytes
let c,r,s=String.concat,List.replicate," Shark"
let p n=r 3(c" "(n+s::r 6"doo"))@[n+s+"!"]
["Baby";"Daddy";"Mommy";"Grandpa";"Grandma"]|>Seq.collect p|>c"
"
And based on @aloisdg version, I get this one:
F# (.NET Core), 130 129 bytes
let p,d=printfn"%s Shark%s"," doo doo"
for i in["Baby";"Daddy";"Mommy";"Grandpa";"Grandma"]do(for _ in"123"do p i (d+d+d));p i"!"
Gaining 1 more char by changine [0..2] by "123" wich is also a sequence of 3 items...
Emacs Lisp, 177 bytes
(defmacro w()`(princ(concat i" Shark doo doo doo doo doo doo\n")))
(defmacro z()`(princ(concat i" Shark!\n")))
(loop for i in'("Baby""Daddy""Mommy""Grandpa")do(and(w)(w)(w)(z)))
F# (.NET Core), 179 bytes
["Baby";"Daddy";"Mommy";"Grandpa";"Grandma"]|>Seq.map(fun i->([0..2]|>Seq.map(fun _->i+" Shark doo doo doo doo doo doo")|>String.concat "\n")+"\n"+i+" Shark!")|>String.concat "\n"
No input, export to a string and to std output in a console.
145 bytes
for i in["Baby";"Daddy";"Mommy";"Grandpa";"Grandma"]do(for _ in[0..2]do printfn"%s"(i+" Shark doo doo doo doo doo doo"));printfn"%s"(i+" Shark!")
No input, export to std output
Wolfram Language (Mathematica), 145 bytes
Nothing special, still thinking of a shorter method.
a={"Baby","Daddy","Mommy","Grandpa","Grandma"};c=" Shark";b=c<>StringJoin@Table[" doo",6];Do[Do[Print[a[[i]]<>b],3];Print[a[[i]]<>c<>"!"];,{i,5}]
VBA (Excel), 152 118 bytes
-34 bytes. Thanks @TaylorScott
Using Immediate Window.
a=Split("Baby Daddy Mommy Grandpa Grandma"):b=" Shark":c=" doo":For d=0To 19:?a(Int(d/4))b &IIf((d+1)Mod 4=0,"!",Join(Split(String$(6,"."),"."),c)):Next
a=Split("Baby Daddy Mommy Grandpa Grandma"):b=" Shark":For d=0To 19:?a(d\4)b;IIf((d+1)Mod 4,[Rept(" doo",6)],"!"):Next
Haskell, 97 bytes
unlines[x++s++p|x<-words"Baby Daddy Mommy Grandpa Grandma",p<-[a,a,a,"!"]]
s=" Shark"
a=s>>" doo"
This is an optimization of the Haskell solution by starsandspirals. The new trick is to iterate over the rows of each stanza with an inner loop, and join the lines using unlines, saving the need to explicitly insert newlines.
The suffixes of the four lines are [a,a,a,"!"], where a is " doo" replicated 6 times with a=s>>" doo", where starsandspirals cleverly reuses the six-character-long s=" Shark". Writing [a,a,a,...] looks a bit silly, but I'm not seeing a shorter way.
A list-monad version is the same length but it looks cool.
unlines$(++).(++s)<$>words"Baby Daddy Mommy Grandpa Grandma"<*>[a,a,a,"!"]
s=" Shark"
a=s>>" doo"
Clean, 134 bytes
import StdEnv,Text
r=repeatn
f=join"\n"[e+" Shark"+concat s\\e<-split" ""Baby Daddy Mommy Grandpa Grandma",s<-r 3(r 6" doo")++[["!"]]]
Jelly, 51 bytes
;“¤⁾ċ»;“¡N³»ẋ6¤;”¶ẋ3;;“ß<Ė»
“þɗ“¡þ"“£H$“æf⁵“æeⱮ»Ç€Y
Jelly isn't the best for string manipulation. Still pretty good.
If you expand out the strings to their ungolfed form, the code looks like this:
;“ Shark”;“ doo”ẋ6¤;“¶”ẋ3;;“ Shark!”
“Baby“Daddy“Mommy“Grandpa“Grandma”Ç€Y
(The string compression was done using user202729's compressor).
;“ Shark”;“ doo”ẋ6¤;“¶”ẋ3;;“ Shark!” Helper Link; take a string and format it into a stanza
;“ Shark” Append " Shark" to the string
; Join
¤ Previous links as a single nilad
“ doo” " doo"
ẋ6 repeated 6 times
;“¶” Append a newline
ẋ3 Repeat 3 times
; Append the string
;“ Shark!” Append " Shark!"
“Baby“Daddy“Mommy“Grandpa“Grandma”Ç€Y Main link
“Baby“Daddy“Mommy“Grandpa“Grandma” ["Baby", "Daddy", "Mommy", "Grandpa", "Grandma"]
Ç€ For each of these words, format it into the stanza with that family position
Y Join by newlines
PHP, 104 bytes
foreach([Baby,Daddy,Mommy,Grandpa,Grandma]as$s)echo$t=$s.str_pad($u=" Shark",30," doo"),"
$t
$t
$s$u!
";
Run with php -nr '<code>' or try it online.
jq, 87 characters
" Shark"as$s|("Baby Daddy Mommy Grandpa Grandma"/" ")[]|(.+$s+" doo"*6+"\n")*3+.+$s+"!"
Sample run:
bash-4.4$ jq -nr '" Shark"as$s|("Baby Daddy Mommy Grandpa Grandma"/" ")[]|(.+$s+" doo"*6+"\n")*3+.+$s+"!"'
Baby Shark doo doo doo doo doo doo
Baby Shark doo doo doo doo doo doo
Baby Shark doo doo doo doo doo doo
Baby Shark!
Daddy Shark doo doo doo doo doo doo
Daddy Shark doo doo doo doo doo doo
Daddy Shark doo doo doo doo doo doo
Daddy Shark!
Mommy Shark doo doo doo doo doo doo
Mommy Shark doo doo doo doo doo doo
Mommy Shark doo doo doo doo doo doo
Mommy Shark!
Grandpa Shark doo doo doo doo doo doo
Grandpa Shark doo doo doo doo doo doo
Grandpa Shark doo doo doo doo doo doo
Grandpa Shark!
Grandma Shark doo doo doo doo doo doo
Grandma Shark doo doo doo doo doo doo
Grandma Shark doo doo doo doo doo doo
Grandma Shark!
PostgreSQL, 162 156 138 bytes
select a||' Shark'||replace(b,'1',repeat(' doo',6))from unnest('{Baby,Daddy,Mommy,Grandpa,Grandma}'::text[])a,unnest('{1,1,1,!}'::text[])b
Ungolfed
select
a || ' Shark' || replace(b,'1',repeat(' doo',6))
from unnest('{Baby,Daddy,Mommy,Grandpa,Grandma}'::text[]) a
,unnest('{1,1,1,!}'::text[]) b
Saved 6 24 bytes thanks to @Nahuel Fouilleul!
- use
||instead ofconcat() - use
unnest('{foo,bar}'::text[])instead ofregexp_split_to_table('foo,bar')
Haskell, 122 113 108 106 104 bytes
s=" Shark";m=do x<-words"Baby Daddy Mommy Grandpa Grandma";("aaa">>x++s++(s>>" doo")++"\n")++x++s++"!\n"
"aaa">>xreplicatesx3 times, as"aaa"has length 3.s>>" doo"replicates" doo"6 times, as" Shark"has length 6!2 bytes saved thanks to @Fox
- 2 bytes saved thanks to @Laikoni
C (compiled with VC++ (Visual Studio 2017)) 536Bytes
#include "stdafx.h"
#define d "doo "
#define p(x) printf(x);
#define n p("\n")
#define b p(f[i])p(" Shark ")
#define l(x,y) for(int x=0;x<y;x++)
void main(){const char*f[]={"Baby","Daddy","Mommy","Grandpa","Grandma"};l(i,5){l(k,3){b;l(j,6)p(d)n}b;p("\b!\n")}}
this is my naive try: it started from the "good version" where everything is done the neat and tidy way and i just removed the blanks, semicolons where possible and curly braces if possible. i changed main from int to void in order to be able to leave out the return Statement in the end if using a different Compiler (say gcc) the stdafx.h can be ommitted (visual Studio throws an error though (or i just dont know how to do it better...)) although then the use of printf means you either have to include stdio.h instead (=1byte win) or you have to use a Compiler flag to add this to the build path although not mentioned in the Code.... if its no dealbreaker if the exclamation mark is one space away from Baby Shark then the \b can be ommitted (=2 Byte win)
bash, 78 bytes
printf %s\\n {Baby,Daddy,Mommy,Grand{p,m}a}\ Shark{" `echo doo{,,}{,}`"{,,},!}
73 bytes if trailing space is allowed
echo '
'{Baby,Daddy,Mommy,Grand{p,m}a}\ Shark{" `echo doo{,,}{,}`"{,,},!}
Perl 5, 84 bytes
print (map{join(" doo"x6,("\n$_ Shark")x4),"!"}qw(Baby Daddy Mommy Grandpa Grandma))
><>, 158 115 bytes
Saved a lot of bytes thanks to Jo King
>4>1-&0'krahS '0l3-.
~ ^oa~<
ooo:?!/1-'ood 'o
\ao'!'^?$6:&~
\!?:o
^'ybaB'
^'yddaD'
^'ymmoM'
^'apdnarG'
^'amdnarG'
;
Try it online! You may also want to paste the code in at fishlanguage.com, where you can see an animation of it swimming running.
05AB1E, 50 41 bytes
“‡ÍÊТ×myîºpaîºma“#ð«'㢫™v…doo6иyšÐy'!«»
Last part And I was right, -9 bytes thanks to @Emigna (even more than I was expecting).v4FN3Qiy'!«ë…doo6иyšðý}, can definitely be golfed a bit..
Explanation:
“‡ÍÊТ×myîºpaîºma“ # Push dictionary string "baby daddy mommy grandpa grandma"
# # Split by spaces: ["baby","daddy","mommy","grandpa","grandma"]
ð« # Append a space to each
'㢫 '# Append dictionary string "shark" to each
™ # Title-case each word
v # Loop `y` over these strings
…doo # Push string "doo"
6и # Repeat it 6 times as list
yš # Prepend the string `y` at the front of the list
Ð # Triplicate this list
y'!« '# Push string `y`, concatted with a "!"
» # Join everything on the stack by newlines
# (and each list implicitly by spaces)
# (and after the loop, output the result implicitly)
See this 05AB1E tip of mine (section How to use the dictionary?) to understand why “‡ÍÊТ×myîºpaîºma“ is "baby daddy mommy grandpa grandma" and '㢠is "shark".
Python 3, 105 97 96 bytes
for x in"Baby","Daddy","Mommy","Grandpa","Grandma":z=x+' Shark';print((z+' doo'*6+"\n")*3+z+"!")
A simple Python 3 solution. (9 bytes saved by Jo King and Quintec)
J, 85 bytes
echo('Shark'(,&'!',~(24$' doo')(3#,:)@,~])@,~]);.2'Baby Daddy Mommy Grandpa Grandma '
Note: This assumes a blank line between stanzas is ok. If that's not the case, prepending ,/ to my solution for +2 bytes.
JavaScript, 104 bytes
More golfing to follow.
_=>`Baby
Daddy
Mommy
Grandpa
Grandma`.replace(/.+/g,x=>(s=(x+=` Shark`)+` doo`.repeat(6)+`
`)+s+s+x+`!`)
Retina 0.8.2, 77 75 74 bytes
Baby¶Daddy¶MommyGpaGma
G
¶Grand
.+
$&s$&s$&s$&S!
s
S6$*O¶
O
doo
S
Shark
Try it online! Explanation:
Baby¶Daddy¶MommyGpaGma
G
¶Grand
Insert the relations on separate lines.
.+
$&s$&s$&s$&S!¶
Expand into four lines.
s
S6$*O¶
O
doo
S
Shark
Expand the placeholders.
69 68 bytes in Retina 1:
Baby¶Daddy¶MommyGpaGma
G
¶Grand
.+
$& Shark
.+
3*$($&6*$( doo)¶)$&!
Try it online! Explanation:
Baby¶Daddy¶MommyGpaGma
G
¶Grand
Insert the relations on separate lines.
.+
$& Shark
Append Shark to each.
.+
3*$($&6*$( doo)¶)$&!
Expand into whole verses.
Japt -R, 55 bytes
Pretty naïve first pass.
`baß'adÝcomæ²T\`èT\`µ`qi Ë'!i4Æ` Srk`iDhDÎuÃqRi6ç` ºo
Ruby, 82 bytes
%w(Baby Daddy Mommy Grandpa Grandma).map{|a|puts [a+" Shark"]*4*(" doo"*6+?\n)+?!}
JavaScript (Node.js), 132 bytes
Probably very golf-able. Generates the "doo doo" line, then creates three of those with the "!" line after, and repeats this for each shark.
a=""
c=" doo"
for(b of["Baby","Daddy","Mommy","Grandpa","Grandma"]){b+=" Shark"
t=b+c+c+c+c+c+c+"\n"
a+=t+t+t+b+"!\n"}console.log(a)
Java (JDK), 135 bytes
v->{for(var s:"Baby Daddy Mommy Grandpa Grandma".split(" "))System.out.println(((s+=" Shark")+" doo".repeat(6)+"\n").repeat(3)+s+"!");}
Attache, 79 bytes
$Baby'$Daddy'$Mommy'$Grandpa'$Grandma+" Shark":>Print@{(_+" doo"*6+lf)*3+_+"!"}
An attempt at compressing the above iteration array is NTS@N=>Split[S@FromBase[Ords@")!-ZOW]NE.kK3(*F(a3\\z6fXD_\\yEM"-32,95],"00"], which is significantly longer than the trivial encoding above. Compressing the string using base conversion in its entirety would likely come out to be longer.
Alternatives
81 bytes: Print@{(_+" doo"*6+lf)*3+_+"!"}=>($Baby'$Daddy'$Mommy'$Grandpa'$Grandma+" Shark")
82 bytes: Output!{(_+" doo"*6+lf)*3+_+"!"}=>($Baby'$Daddy'$Mommy'$Grandpa'$Grandma+" Shark")
86 bytes: Output!(""'3&(" doo"*6+lf)'"!")&Join=>($Baby'$Daddy'$Mommy'$Grandpa'$Grandma+" Shark")
87 bytes: Output!(""'3&(" doo"*6+lf)'"!")&Join@`+&" Shark"=>$Baby'$Daddy'$Mommy'$Grandpa'$Grandma
///, 124 bytes
/*/$!
//)/Grand//(/Baby//'/Mommy//&/Daddy//%/ doo//$/ Shark//#/a")//"/$%%%%%%
/("("("(*&"&"&"&*'"'"'"'*)p#p#p#pa*)m#m#m#ma$!
cQuents, 93 89 bytes
|
#20&bk)~" Shark"~(" doo"6,Z,Z,bk)~" Shark!"
:"Baby","Daddy","Mommy","Grandpa","Grandma"
Note that as of posting TIO is not updated to the latest version, so the TIO link may not work.
Explanation
| Set delimiter to newline
#20 n = 20
& Output first n terms in sequence
k = 1
First term is
bk)~" Shark" kth term from the third line concatenated to " Shark"
~(" doo"6, concatenated to " doo" repeated 6 times
Z,Z, Second and third terms equal the first term
bk)~" Shark!" Fourth term is the kth term from the third line concatenated to " Shark!"
k += 1, restart
Third line 5 terms, each a string
Python 2, 93 bytes
for w in"Baby Daddy Mommy Grandpa Grandma".split():w+=" Shark";print(w+" doo"*6+"\n")*3+w+"!"
94 bytes
for w in"Baby Daddy Mommy Grandpa Grandma".split():print((" doo"*6+"\n%s Shark"%w)*4)[25:]+"!"
Perl 6, 79 78 bytes
(<Baby Daddy Mommmy Grandpa Grandma>X~" Shark"X~ |((" doo"x 6)xx 3),'!')>>.say
Pretty simple.
Explanation:
<...>X~ # Combine family members
" Shark"X~ # With "Shark" and
|((" doo"x 6)xx 3) # doo repeated 6 times then 3 times
,'!' # Then !
( )>>.say # And print each line
