77
\$\begingroup\$

"Baby Shark" is a children's song about a family of sharks. Having long been popular as a campfire song, it has been popularized since the mid-2000s by social media, online video and radio. - Wikipedia

Write program that takes no input, and writes the following text to the standard output or an arbitrary file:

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!

This is code golf โ€” shortest code wins.

Found this on Reddit^1^2, and it seems like an interesting challenge to golf.

Updates:

No newline between stanzas, that makes it too easy :)

Leading/trailing newlines are okay.

\$\endgroup\$
18
  • 6
    \$\begingroup\$ Is a newline between each stanza (each shark) acceptable? (That's always how I've seen the lyrics written) \$\endgroup\$
    – Quintec
    Feb 16 '19 at 2:00
  • 9
    \$\begingroup\$ Eh, missing a few verses, like all the ones about the swimmers swimming and losing limbs in shark attacks. \$\endgroup\$
    – mbomb007
    Feb 16 '19 at 17:23
  • 3
    \$\begingroup\$ "doo doo doo doo doo doo" is really over-simplified. \$\endgroup\$ Feb 17 '19 at 23:54
  • 32
    \$\begingroup\$ As a parent, I feel the strongest urge to downvote this one. I'm repressing the urge because that's not how Stack Exchange works. But if I find myself humming "doo doo doo doo" later today, I'm coming back here and holding you accountable! \$\endgroup\$
    – Cort Ammon
    Feb 18 '19 at 17:22
  • 5
    \$\begingroup\$ How many people's days ruined now that this is on HNQs? \$\endgroup\$
    – CactusCake
    Feb 18 '19 at 19:49

66 Answers 66

83
\$\begingroup\$

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๐Ÿ”ค!๐Ÿ”ค๐Ÿชโ—๏ธ๐Ÿ‰๐Ÿ‰

Run it

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:

๐Ÿ‘ถ๐Ÿฆˆ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ
๐Ÿ‘ถ๐Ÿฆˆ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ
๐Ÿ‘ถ๐Ÿฆˆ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ
๐Ÿ‘ถ๐Ÿฆˆ!
๐Ÿ‘จ๐Ÿฆˆ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ
๐Ÿ‘จ๐Ÿฆˆ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ
๐Ÿ‘จ๐Ÿฆˆ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ
๐Ÿ‘จ๐Ÿฆˆ!
๐Ÿคฑ๐Ÿฆˆ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ
๐Ÿคฑ๐Ÿฆˆ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ
๐Ÿคฑ๐Ÿฆˆ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ
๐Ÿคฑ๐Ÿฆˆ!
๐Ÿ‘ด๐Ÿฆˆ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ
๐Ÿ‘ด๐Ÿฆˆ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ
๐Ÿ‘ด๐Ÿฆˆ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ
๐Ÿ‘ด๐Ÿฆˆ!
๐Ÿ‘ต๐Ÿฆˆ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ
๐Ÿ‘ต๐Ÿฆˆ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ
๐Ÿ‘ต๐Ÿฆˆ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ
๐Ÿ‘ต๐Ÿฆˆ!

Run it

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 ๐Ÿฆˆ!โ—๏ธ
๐Ÿ‰
\$\endgroup\$
9
  • 33
    \$\begingroup\$ Points for creativity, but this doesn't produce the required output \$\endgroup\$
    – Jo King
    Feb 17 '19 at 10:23
  • 15
    \$\begingroup\$ Welcome to the site! As JoKing was getting at we require that answers do exactly what the question ask here. This means that while your interpretation of the challenge is creative this answer should either be fixed to produce the correct output or deleted. \$\endgroup\$
    – Grain Ghost
    Feb 17 '19 at 14:10
  • 12
    \$\begingroup\$ While this answer is creative, it does not follow the requirements of the challenge, and thus is not valid - the text must be output exactly as stated in the challenge. \$\endgroup\$
    – user45941
    Feb 17 '19 at 20:17
  • 8
    \$\begingroup\$ Please either modify this answer to produce the correct output, or delete it. \$\endgroup\$
    – mbomb007
    Feb 18 '19 at 19:55
  • 6
    \$\begingroup\$ Welcome to the site! When I try to run this code online, I get an error. (It also counts 98 characters instead of 94). Am I missing something? \$\endgroup\$
    – DJMcMayhem
    Feb 19 '19 at 18:28
41
\$\begingroup\$

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,'$'

Try it online!

Output

DOS DIR, SHARK

(TODO: update this screenshot for one less byte...)

\$\endgroup\$
4
  • 11
    \$\begingroup\$ You absolute madman. \$\endgroup\$
    – MGOwen
    Feb 20 '19 at 0:34
  • 11
    \$\begingroup\$ When you said Download SHARK.COM!, I immediately thought of computer viruses. \$\endgroup\$
    – MilkyWay90
    Feb 20 '19 at 16:40
  • \$\begingroup\$ @gwaugh I was kidding \$\endgroup\$
    – MilkyWay90
    Feb 20 '19 at 16:46
  • \$\begingroup\$ @gwaugh But it's 109 bytes \$\endgroup\$
    – MilkyWay90
    Feb 20 '19 at 16:50
22
\$\begingroup\$

Python 2, 93 bytes

for w in"Baby Daddy Mommy Grandpa Grandma".split():w+=" Shark";print(w+" doo"*6+"\n")*3+w+"!"

Try it online!

94 bytes

for w in"Baby Daddy Mommy Grandpa Grandma".split():print((" doo"*6+"\n%s Shark"%w)*4)[25:]+"!"

Try it online!

\$\endgroup\$
19
\$\begingroup\$

05AB1E, 50 41 bytes

โ€œโ€กรรŠรยขร—myรฎยบpaรฎยบmaโ€œ#รฐยซ'รฃยขยซโ„ขvโ€ฆdoo6ะธyลกรy'!ยซยป

Last part v4FN3Qiy'!ยซรซโ€ฆdoo6ะธyลกรฐรฝ}, can definitely be golfed a bit.. And I was right, -9 bytes thanks to @Emigna (even more than I was expecting).

Try it online.

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".

\$\endgroup\$
2
  • 2
    \$\begingroup\$ You can golf 9 bytes of that last bit with vโ€ฆdoo6ะธyลกÐy'!«» \$\endgroup\$
    – Emigna
    Feb 16 '19 at 16:01
  • \$\begingroup\$ @Emigna You even golfed more than I was expected, thanks! Smart way of using the triplicate and »! \$\endgroup\$ Feb 16 '19 at 17:27
15
\$\begingroup\$

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!"}

Try it online!

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!

\$\endgroup\$
5
  • 2
    \$\begingroup\$ 80 bytes :) \$\endgroup\$
    – mazzy
    Feb 16 '19 at 7:29
  • 1
    \$\begingroup\$ You can save another byte by assigning "$_ Shark" to a variable and re-using it. \$\endgroup\$
    – Joey
    Feb 18 '19 at 11:00
  • 2
    \$\begingroup\$ 76 bytes using echo instead of -split. \$\endgroup\$ Feb 19 '19 at 20:27
  • 1
    \$\begingroup\$ I think you should have a "text to speech" in there as well :p For the hell of it tried to combine it a bit with this code, didn't quite work :-) \$\endgroup\$
    – rkeet
    Feb 20 '19 at 9:04
  • \$\begingroup\$ @rkeet Challenge accepted! I am currently puzzling this out. \$\endgroup\$
    – GMills
    Feb 20 '19 at 14:34
13
\$\begingroup\$

SOGL, 40 bytes

oโ…ฮทvฮ’vPฮโ”˜รทฮ–nฮจโ€˜ฮธ{"nOe;โ€˜+ลซ:" dooโ€6*+TTPPฤผ!

Try it here!

\$\endgroup\$
12
\$\begingroup\$

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+"!");}

Try it online!

\$\endgroup\$
2
  • \$\begingroup\$ Which JDK version? I'm guessing 8+ (lambdas). \$\endgroup\$ Feb 17 '19 at 19:46
  • 3
    \$\begingroup\$ @NoOneIsHere Given the repeat method, it's version 11+ \$\endgroup\$ Feb 17 '19 at 21:44
10
\$\begingroup\$

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.

\$\endgroup\$
10
\$\begingroup\$

Python 3, 105 97 96 bytes

for x in"Baby","Daddy","Mommy","Grandpa","Grandma":z=x+' Shark';print((z+' doo'*6+"\n")*3+z+"!")

Try it online!

A simple Python 3 solution. (9 bytes saved by Jo King and Quintec)

\$\endgroup\$
8
  • 2
    \$\begingroup\$ The parentheses around ' doo'*6 are unnecessary and you have unnecessary whitespace there \$\endgroup\$
    – Quintec
    Feb 16 '19 at 2:06
  • 1
    \$\begingroup\$ What quintec said... 97 bytes \$\endgroup\$
    – Jo King
    Feb 16 '19 at 2:07
  • 2
    \$\begingroup\$ @ReverseCold technically where there's no [] it's a tuple not a list, but that's not relevant to this program \$\endgroup\$
    – Stephen
    Feb 16 '19 at 2:58
  • 2
    \$\begingroup\$ 96 bytes by setting x+' Shark' to a variable \$\endgroup\$
    – Jo King
    Feb 16 '19 at 8:07
  • 1
    \$\begingroup\$ This seems to work in 2.7 as well? \$\endgroup\$
    – uhoh
    Feb 19 '19 at 1:54
10
\$\begingroup\$

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"

Try it online!

  • "aaa">>x replicates x 3 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
\$\endgroup\$
6
  • 2
    \$\begingroup\$ Welcome to the site! We allow just generating a fixed output string as an expression, so you can omit the main=putStr. See also the Haskell rules summary. \$\endgroup\$
    – xnor
    Feb 16 '19 at 21:54
  • 1
    \$\begingroup\$ Welcome to PPCG. Nice saving with s>>. \$\endgroup\$
    – Shaggy
    Feb 16 '19 at 22:05
  • \$\begingroup\$ @xnor thanks for the links! \$\endgroup\$ Feb 16 '19 at 22:09
  • 1
    \$\begingroup\$ m=(stuff) can just be m=stuff for two fewer bytes \$\endgroup\$
    – Fox
    Feb 17 '19 at 21:42
  • 1
    \$\begingroup\$ 104 bytes by using do-notation: Try it online! \$\endgroup\$
    – Laikoni
    Feb 18 '19 at 7:55
9
\$\begingroup\$

bash, 78 bytes

printf %s\\n {Baby,Daddy,Mommy,Grand{p,m}a}\ Shark{" `echo doo{,,}{,}`"{,,},!}

TIO

73 bytes if trailing space is allowed

echo '
'{Baby,Daddy,Mommy,Grand{p,m}a}\ Shark{" `echo doo{,,}{,}`"{,,},!}
\$\endgroup\$
7
\$\begingroup\$

Perl 6, 79 78 bytes

(<Baby Daddy Mommmy Grandpa Grandma>X~" Shark"X~ |((" doo"x 6)xx 3),'!')>>.say

Try it online!

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
\$\endgroup\$
7
\$\begingroup\$

Ruby, 82 bytes

%w(Baby Daddy Mommy Grandpa Grandma).map{|a|puts [a+" Shark"]*4*(" doo"*6+?\n)+?!}

Try it online!

\$\endgroup\$
2
  • \$\begingroup\$ It took me a while to understand that you used the "doo" part as array seperators. Good job :) \$\endgroup\$
    – Idva
    Feb 18 '19 at 13:11
  • \$\begingroup\$ ?\n can be replaced with $/. \$\endgroup\$
    – Value Ink
    Nov 20 '19 at 21:27
7
\$\begingroup\$

JavaScript, 104 bytes

More golfing to follow.

_=>`Baby
Daddy
Mommy
Grandpa
Grandma`.replace(/.+/g,x=>(s=(x+=` Shark`)+` doo`.repeat(6)+`
`)+s+s+x+`!`)

Try It Online!

\$\endgroup\$
3
  • 1
    \$\begingroup\$ This technically isn't a valid solution since it neither writes to a file or logs it. Though if you make it a valid solution by wrapping with a console.log(), you can make it not a lambda declaration (only 10 character gain) \$\endgroup\$
    – Delioth
    Feb 18 '19 at 21:13
  • 3
    \$\begingroup\$ @Delioth, returning from a function is perfectly valid on this site. Have a look on Meta for our default I/O rules. \$\endgroup\$
    – Shaggy
    Feb 18 '19 at 21:43
  • 2
    \$\begingroup\$ I would generally agree, but this question specifically states that the program "writes the following text to the standard output or an arbitrary file" \$\endgroup\$
    – Delioth
    Feb 18 '19 at 21:51
6
\$\begingroup\$

///, 124 bytes

/*/$!
//)/Grand//(/Baby//'/Mommy//&/Daddy//%/ doo//$/ Shark//#/a")//"/$%%%%%%
/("("("(*&"&"&"&*'"'"'"'*)p#p#p#pa*)m#m#m#ma$!

Try it online!

\$\endgroup\$
6
\$\begingroup\$

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 of concat()
  • use unnest('{foo,bar}'::text[]) instead of regexp_split_to_table('foo,bar')

DB<>fiddle

\$\endgroup\$
2
  • 2
    \$\begingroup\$ -6 bytes using ||instead of concat View on DB Fiddle \$\endgroup\$ Feb 18 '19 at 9:22
  • 2
    \$\begingroup\$ select a||' Shark'||replace(b,'1',repeat(' doo',6))from unnest('{Baby,Daddy,Mommy,Grandpa,Grandma}'::text[])a,unnest('{1,1,1,!}'::text[])b \$\endgroup\$ Feb 18 '19 at 9:48
6
\$\begingroup\$

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.

Try it online!

\$\endgroup\$
5
\$\begingroup\$

><>, 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.

\$\endgroup\$
3
  • \$\begingroup\$ 121 bytes, mostly through rearranging the baby/daddy/... to multiple lines instead of one line. There's more to golf though \$\endgroup\$
    – Jo King
    Feb 16 '19 at 8:58
  • \$\begingroup\$ 115 bytes \$\endgroup\$
    – Jo King
    Feb 16 '19 at 9:24
  • \$\begingroup\$ @JoKing Ah, thanks. I tend to assume (mostly from working with BitCycle) that fewer lines are better, but in this case that's not true because of the different string lengths. \$\endgroup\$
    – DLosc
    Feb 16 '19 at 21:27
5
\$\begingroup\$

Haskell, 97 bytes

unlines[x++s++p|x<-words"Baby Daddy Mommy Grandpa Grandma",p<-[a,a,a,"!"]]
s=" Shark"
a=s>>" doo"

Try it online!

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"

Try it online!

\$\endgroup\$
4
\$\begingroup\$

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!

Try it online!

\$\endgroup\$
1
4
\$\begingroup\$

whenyouaccidentallylose100endorsementsinnationstates - 123,065 121,716 113,695 100,889 98,554 bytes

The program

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).

\$\endgroup\$
2
  • \$\begingroup\$ What the hell is this? I love it \$\endgroup\$
    – adrian
    Feb 19 '19 at 1:21
  • \$\begingroup\$ @AdrianZhang A programming language hard to program it. Also, the program looks like it's a person screaming ('AAAAAAAAAAA...') \$\endgroup\$
    – MilkyWay90
    Feb 19 '19 at 1:47
4
\$\begingroup\$

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,"!"))

Try it online!

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)

Try it online!

\$\endgroup\$
10
  • 1
    \$\begingroup\$ 122 bytes \$\endgroup\$
    – Giuseppe
    Feb 19 '19 at 16:06
  • \$\begingroup\$ As always, thank you for your wise input @Giuseppe. I should have noticed those golfs \$\endgroup\$
    – Sumner18
    Feb 19 '19 at 17:59
  • 1
    \$\begingroup\$ 120 bytes \$\endgroup\$
    – Giuseppe
    Feb 19 '19 at 19:08
  • 1
    \$\begingroup\$ @Giuseppe wow, vectorization, nice. I forgot R has nice vectorization like this. 114? also 114? \$\endgroup\$
    – ASCII-only
    Feb 21 '19 at 22:49
  • 1
    \$\begingroup\$ also 114 \$\endgroup\$
    – ASCII-only
    Feb 21 '19 at 22:55
3
\$\begingroup\$

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.

\$\endgroup\$
1
3
\$\begingroup\$

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.

Try it online!

Edit: Saved 1 byte by using carriage return as per comment by Jonathan Frech

\$\endgroup\$
6
  • \$\begingroup\$ Hello and welcome to PPCG! I have added links to the user's answers you mentioned to better compare your solutions. Congratulations on outgolfing both, could you add a link to an online testing environment for ease of verification? \$\endgroup\$ Feb 19 '19 at 13:13
  • \$\begingroup\$ Thanks for the edit @JonathanFrech. I have now added a link to test the code online (which added a byte to my answer!). \$\endgroup\$
    – BobbyBean
    Feb 19 '19 at 14:07
  • \$\begingroup\$ You can use an actual new line instead of \n to bring your byte count one back down again. \$\endgroup\$ Feb 19 '19 at 14:10
  • \$\begingroup\$ 125 bytes \$\endgroup\$
    – Giuseppe
    Feb 19 '19 at 16:10
  • 1
    \$\begingroup\$ Well I've been totally outgolfed; sometimes the simplest option is best. Also highlights how difficult it is to work with strings in R. \$\endgroup\$
    – CT Hall
    Feb 19 '19 at 17:41
3
\$\begingroup\$

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.

Try it online

\$\endgroup\$
3
  • \$\begingroup\$ welcome to ppcg! At the very least, replacing the "\n" with a literal newline will save one byte. \$\endgroup\$
    – JDL
    Feb 19 '19 at 13:34
  • \$\begingroup\$ Thanks, I did so, and then realized my output was bit off so I updated that, sadly it resulted in more bytes. \$\endgroup\$
    – CT Hall
    Feb 19 '19 at 15:50
  • \$\begingroup\$ I believe you have a trailing newline for an extra byte \$\endgroup\$
    – Giuseppe
    Feb 19 '19 at 16:08
3
\$\begingroup\$

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)

\$\endgroup\$
3
\$\begingroup\$

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:"!");}

Try it online!

\$\endgroup\$
3
  • \$\begingroup\$ What are the rules for C? No need for main(), or #include for printf? \$\endgroup\$
    – BoBTFish
    Feb 21 '19 at 8:19
  • \$\begingroup\$ @BoBTFish: Not C-specific but generally it is allowed to use any function (name doesn't matter, indeed it can be an unnamed lambda or similar). And languages are defined by their (any) implementation, since this works on gcc (only generates warnings, but compiles fine) it is valid. \$\endgroup\$ Feb 22 '19 at 14:27
  • \$\begingroup\$ I realised the lack of #include was only an error because I was still compiling as C++, but I still couldn't get it to compile without renaming your function to main. \$\endgroup\$
    – BoBTFish
    Feb 22 '19 at 15:30
3
\$\begingroup\$

Jelly, 42 bytes

โ€œยกNยณยปแบ‹6Wแบ‹3;โ€!แนญโ‚ฌ;Y
โ€œยกส‚ษ“แน™แนขยฎร‘R+ยฃแนญแปคแน™ยปแธฒรงโ‚ฌโ€œยคโพฤ‹ยปY

Try it online!

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
\$\endgroup\$
3
\$\begingroup\$

05AB1E, 39 38 bytes

โ€โ€กรรŠรยขร—myรฎยบpaรฎยบmaโ€#โ€žoโ‚ฌยทร€6ร—3ะธ'!ยชโ€รฃยขโ€รฌรขยป

Try it online!

โ€โ€กรรŠรยขร—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
\$\endgroup\$
3
+100
\$\begingroup\$

APL (Dyalog Unicode), 72 bytes (SBCS)

โ†‘,(,โˆ˜' Shark'ยจ'BabyDaddyMommyGrandpaGrandma'(โˆŠโŠ‚โŠฃ)โŽ•A)โˆ˜.,'!',โจ3โดโŠ‚24โด' doo'

Try it online!

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

\$\endgroup\$
3
  • \$\begingroup\$ -14 \$\endgroup\$
    – Razetime
    Dec 13 '20 at 15:27
  • \$\begingroup\$ -28 \$\endgroup\$
    – Adám
    Dec 13 '20 at 16:58
  • \$\begingroup\$ @Adám that's a whole lot smaller, I'll analyze that in a short while. Thanks. \$\endgroup\$ Dec 13 '20 at 16:59

Your Answer

By clicking โ€œPost Your Answerโ€, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.