Sing Baby Shark
Emojicode, 292 bytes (140 characters)
Baby➡️bDaddy➡️yMommy➡️oGrandpa➡️gGrandma➡️a Shark➡️s doo➡️db y o g a➡️fm fi⏩⏩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)
➡️fm fi⏩⏩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)
➡️fm fi⏩⏩0 3❗️m❗️m!❗️
Expanded out:
➡️f
m f
i ⏩⏩ 0 3❗️
m ❗️
m !❗️
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
(TODO: update this screenshot for one less byte...)
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!