Sing Baby Shark
$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.
code-golf string kolmogorov-complexity
New contributor
$endgroup$
add a comment |
$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.
code-golf string kolmogorov-complexity
New contributor
$endgroup$
1
$begingroup$
Is a newline between each stanza (each shark) acceptable? (That's always how I've seen the lyrics written)
$endgroup$
– Quintec
1 hour ago
add a comment |
$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.
code-golf string kolmogorov-complexity
New contributor
$endgroup$
"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.
code-golf string kolmogorov-complexity
code-golf string kolmogorov-complexity
New contributor
New contributor
New contributor
asked 1 hour ago
ReverseColdReverseCold
1314
1314
New contributor
New contributor
1
$begingroup$
Is a newline between each stanza (each shark) acceptable? (That's always how I've seen the lyrics written)
$endgroup$
– Quintec
1 hour ago
add a comment |
1
$begingroup$
Is a newline between each stanza (each shark) acceptable? (That's always how I've seen the lyrics written)
$endgroup$
– Quintec
1 hour ago
1
1
$begingroup$
Is a newline between each stanza (each shark) acceptable? (That's always how I've seen the lyrics written)
$endgroup$
– Quintec
1 hour ago
$begingroup$
Is a newline between each stanza (each shark) acceptable? (That's always how I've seen the lyrics written)
$endgroup$
– Quintec
1 hour ago
add a comment |
7 Answers
7
active
oldest
votes
$begingroup$
Retina 0.8.2, 77 75 bytes
Baby¶Daddy¶Mommy¶Grandpa¶Grandma
.+
$&s$&s$&s$&S!
s
S6$*O¶
O
doo
S
Shark
Try it online! Explanation:
Baby¶Daddy¶Mommy¶Grandpa¶Grandma
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 bytes in Retina 1:
Baby¶Daddy¶Mommy¶Grandpa¶Grandma
.+
$& Shark
.+
3*$($&6*$( doo)¶)$&!
Try it online! Explanation:
Baby¶Daddy¶Mommy¶Grandpa¶Grandma
Insert the relations on separate lines.
.+
$& Shark
Append Shark to each.
.+
3*$($&6*$( doo)¶)$&!
Expand into whole verses.
$endgroup$
add a comment |
$begingroup$
Python 3, 105 97 bytes
for x in"Baby","Daddy","Mommy","Grandpa","Grandma":print((x+' Shark'+' doo'*6+"n")*3+x,"Shark!")
Try it online!
A simple Python 3 solution. (8 bytes saved by Jo King and Quintec)
New contributor
$endgroup$
1
$begingroup$
The parentheses around' doo'*6
are unnecessary and you have unnecessary whitespace there
$endgroup$
– Quintec
1 hour ago
1
$begingroup$
What quintec said... 97 bytes
$endgroup$
– Jo King
1 hour ago
$begingroup$
Huh, didn't know you could do lists without, or that you didn't need a newline for
:
. Thanks!
$endgroup$
– ReverseCold
1 hour ago
$begingroup$
@ReverseCold technically where there's noit's a tuple not a list, but that's not relevant to this program
$endgroup$
– Stephen
36 mins ago
add a comment |
$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$
add a comment |
$begingroup$
PowerShell, 88 86 85 bytes
"Baby0Daddy0Mommy0Grandpa0Grandma"-split0|%{("$_ Shark"+" doo"*6+"`r")*3;"$_ Shark!"}
Try it online!
Just to get the ball rolling.
$endgroup$
add a comment |
$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$
add a comment |
$begingroup$
C# (Visual C# Interactive Compiler), 153 bytes
foreach(var i in"Baby Daddy Mommy Grandpa Grandma".Split())Write(string.Concat(Enumerable.Repeat(i+" Shark doo doo doo doo doo doon",3))+i+" Shark!n");
Try it online!
$endgroup$
add a comment |
$begingroup$
cQuents, 93 89 bytes
|
#20&bk)~" Shark"~(" doo"6,Z,Z,bk)~" Shark!"
:"Baby","Daddy","Mommy","Grandpa","Grandma"
Try it online!
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
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
});
});
}, "mathjax-editing");
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "200"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
ReverseCold is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f179998%2fsing-baby-shark%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
7 Answers
7
active
oldest
votes
7 Answers
7
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Retina 0.8.2, 77 75 bytes
Baby¶Daddy¶Mommy¶Grandpa¶Grandma
.+
$&s$&s$&s$&S!
s
S6$*O¶
O
doo
S
Shark
Try it online! Explanation:
Baby¶Daddy¶Mommy¶Grandpa¶Grandma
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 bytes in Retina 1:
Baby¶Daddy¶Mommy¶Grandpa¶Grandma
.+
$& Shark
.+
3*$($&6*$( doo)¶)$&!
Try it online! Explanation:
Baby¶Daddy¶Mommy¶Grandpa¶Grandma
Insert the relations on separate lines.
.+
$& Shark
Append Shark to each.
.+
3*$($&6*$( doo)¶)$&!
Expand into whole verses.
$endgroup$
add a comment |
$begingroup$
Retina 0.8.2, 77 75 bytes
Baby¶Daddy¶Mommy¶Grandpa¶Grandma
.+
$&s$&s$&s$&S!
s
S6$*O¶
O
doo
S
Shark
Try it online! Explanation:
Baby¶Daddy¶Mommy¶Grandpa¶Grandma
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 bytes in Retina 1:
Baby¶Daddy¶Mommy¶Grandpa¶Grandma
.+
$& Shark
.+
3*$($&6*$( doo)¶)$&!
Try it online! Explanation:
Baby¶Daddy¶Mommy¶Grandpa¶Grandma
Insert the relations on separate lines.
.+
$& Shark
Append Shark to each.
.+
3*$($&6*$( doo)¶)$&!
Expand into whole verses.
$endgroup$
add a comment |
$begingroup$
Retina 0.8.2, 77 75 bytes
Baby¶Daddy¶Mommy¶Grandpa¶Grandma
.+
$&s$&s$&s$&S!
s
S6$*O¶
O
doo
S
Shark
Try it online! Explanation:
Baby¶Daddy¶Mommy¶Grandpa¶Grandma
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 bytes in Retina 1:
Baby¶Daddy¶Mommy¶Grandpa¶Grandma
.+
$& Shark
.+
3*$($&6*$( doo)¶)$&!
Try it online! Explanation:
Baby¶Daddy¶Mommy¶Grandpa¶Grandma
Insert the relations on separate lines.
.+
$& Shark
Append Shark to each.
.+
3*$($&6*$( doo)¶)$&!
Expand into whole verses.
$endgroup$
Retina 0.8.2, 77 75 bytes
Baby¶Daddy¶Mommy¶Grandpa¶Grandma
.+
$&s$&s$&s$&S!
s
S6$*O¶
O
doo
S
Shark
Try it online! Explanation:
Baby¶Daddy¶Mommy¶Grandpa¶Grandma
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 bytes in Retina 1:
Baby¶Daddy¶Mommy¶Grandpa¶Grandma
.+
$& Shark
.+
3*$($&6*$( doo)¶)$&!
Try it online! Explanation:
Baby¶Daddy¶Mommy¶Grandpa¶Grandma
Insert the relations on separate lines.
.+
$& Shark
Append Shark to each.
.+
3*$($&6*$( doo)¶)$&!
Expand into whole verses.
edited 1 hour ago
answered 1 hour ago
NeilNeil
80.7k744178
80.7k744178
add a comment |
add a comment |
$begingroup$
Python 3, 105 97 bytes
for x in"Baby","Daddy","Mommy","Grandpa","Grandma":print((x+' Shark'+' doo'*6+"n")*3+x,"Shark!")
Try it online!
A simple Python 3 solution. (8 bytes saved by Jo King and Quintec)
New contributor
$endgroup$
1
$begingroup$
The parentheses around' doo'*6
are unnecessary and you have unnecessary whitespace there
$endgroup$
– Quintec
1 hour ago
1
$begingroup$
What quintec said... 97 bytes
$endgroup$
– Jo King
1 hour ago
$begingroup$
Huh, didn't know you could do lists without, or that you didn't need a newline for
:
. Thanks!
$endgroup$
– ReverseCold
1 hour ago
$begingroup$
@ReverseCold technically where there's noit's a tuple not a list, but that's not relevant to this program
$endgroup$
– Stephen
36 mins ago
add a comment |
$begingroup$
Python 3, 105 97 bytes
for x in"Baby","Daddy","Mommy","Grandpa","Grandma":print((x+' Shark'+' doo'*6+"n")*3+x,"Shark!")
Try it online!
A simple Python 3 solution. (8 bytes saved by Jo King and Quintec)
New contributor
$endgroup$
1
$begingroup$
The parentheses around' doo'*6
are unnecessary and you have unnecessary whitespace there
$endgroup$
– Quintec
1 hour ago
1
$begingroup$
What quintec said... 97 bytes
$endgroup$
– Jo King
1 hour ago
$begingroup$
Huh, didn't know you could do lists without, or that you didn't need a newline for
:
. Thanks!
$endgroup$
– ReverseCold
1 hour ago
$begingroup$
@ReverseCold technically where there's noit's a tuple not a list, but that's not relevant to this program
$endgroup$
– Stephen
36 mins ago
add a comment |
$begingroup$
Python 3, 105 97 bytes
for x in"Baby","Daddy","Mommy","Grandpa","Grandma":print((x+' Shark'+' doo'*6+"n")*3+x,"Shark!")
Try it online!
A simple Python 3 solution. (8 bytes saved by Jo King and Quintec)
New contributor
$endgroup$
Python 3, 105 97 bytes
for x in"Baby","Daddy","Mommy","Grandpa","Grandma":print((x+' Shark'+' doo'*6+"n")*3+x,"Shark!")
Try it online!
A simple Python 3 solution. (8 bytes saved by Jo King and Quintec)
New contributor
edited 1 hour ago
New contributor
answered 1 hour ago
ReverseColdReverseCold
1314
1314
New contributor
New contributor
1
$begingroup$
The parentheses around' doo'*6
are unnecessary and you have unnecessary whitespace there
$endgroup$
– Quintec
1 hour ago
1
$begingroup$
What quintec said... 97 bytes
$endgroup$
– Jo King
1 hour ago
$begingroup$
Huh, didn't know you could do lists without, or that you didn't need a newline for
:
. Thanks!
$endgroup$
– ReverseCold
1 hour ago
$begingroup$
@ReverseCold technically where there's noit's a tuple not a list, but that's not relevant to this program
$endgroup$
– Stephen
36 mins ago
add a comment |
1
$begingroup$
The parentheses around' doo'*6
are unnecessary and you have unnecessary whitespace there
$endgroup$
– Quintec
1 hour ago
1
$begingroup$
What quintec said... 97 bytes
$endgroup$
– Jo King
1 hour ago
$begingroup$
Huh, didn't know you could do lists without, or that you didn't need a newline for
:
. Thanks!
$endgroup$
– ReverseCold
1 hour ago
$begingroup$
@ReverseCold technically where there's noit's a tuple not a list, but that's not relevant to this program
$endgroup$
– Stephen
36 mins ago
1
1
$begingroup$
The parentheses around
' doo'*6
are unnecessary and you have unnecessary whitespace there$endgroup$
– Quintec
1 hour ago
$begingroup$
The parentheses around
' doo'*6
are unnecessary and you have unnecessary whitespace there$endgroup$
– Quintec
1 hour ago
1
1
$begingroup$
What quintec said... 97 bytes
$endgroup$
– Jo King
1 hour ago
$begingroup$
What quintec said... 97 bytes
$endgroup$
– Jo King
1 hour ago
$begingroup$
Huh, didn't know you could do lists without
, or that you didn't need a newline for :
. Thanks!$endgroup$
– ReverseCold
1 hour ago
$begingroup$
Huh, didn't know you could do lists without
, or that you didn't need a newline for :
. Thanks!$endgroup$
– ReverseCold
1 hour ago
$begingroup$
@ReverseCold technically where there's no
it's a tuple not a list, but that's not relevant to this program$endgroup$
– Stephen
36 mins ago
$begingroup$
@ReverseCold technically where there's no
it's a tuple not a list, but that's not relevant to this program$endgroup$
– Stephen
36 mins ago
add a comment |
$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$
add a comment |
$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$
add a comment |
$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$
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
edited 55 mins ago
answered 1 hour ago
Jo KingJo King
22.9k253120
22.9k253120
add a comment |
add a comment |
$begingroup$
PowerShell, 88 86 85 bytes
"Baby0Daddy0Mommy0Grandpa0Grandma"-split0|%{("$_ Shark"+" doo"*6+"`r")*3;"$_ Shark!"}
Try it online!
Just to get the ball rolling.
$endgroup$
add a comment |
$begingroup$
PowerShell, 88 86 85 bytes
"Baby0Daddy0Mommy0Grandpa0Grandma"-split0|%{("$_ Shark"+" doo"*6+"`r")*3;"$_ Shark!"}
Try it online!
Just to get the ball rolling.
$endgroup$
add a comment |
$begingroup$
PowerShell, 88 86 85 bytes
"Baby0Daddy0Mommy0Grandpa0Grandma"-split0|%{("$_ Shark"+" doo"*6+"`r")*3;"$_ Shark!"}
Try it online!
Just to get the ball rolling.
$endgroup$
PowerShell, 88 86 85 bytes
"Baby0Daddy0Mommy0Grandpa0Grandma"-split0|%{("$_ Shark"+" doo"*6+"`r")*3;"$_ Shark!"}
Try it online!
Just to get the ball rolling.
edited 1 hour ago
answered 1 hour ago
Gabriel MillsGabriel Mills
301210
301210
add a comment |
add a comment |
$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$
add a comment |
$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$
add a comment |
$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$
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!
answered 43 mins ago
xnorxnor
90.5k18185439
90.5k18185439
add a comment |
add a comment |
$begingroup$
C# (Visual C# Interactive Compiler), 153 bytes
foreach(var i in"Baby Daddy Mommy Grandpa Grandma".Split())Write(string.Concat(Enumerable.Repeat(i+" Shark doo doo doo doo doo doon",3))+i+" Shark!n");
Try it online!
$endgroup$
add a comment |
$begingroup$
C# (Visual C# Interactive Compiler), 153 bytes
foreach(var i in"Baby Daddy Mommy Grandpa Grandma".Split())Write(string.Concat(Enumerable.Repeat(i+" Shark doo doo doo doo doo doon",3))+i+" Shark!n");
Try it online!
$endgroup$
add a comment |
$begingroup$
C# (Visual C# Interactive Compiler), 153 bytes
foreach(var i in"Baby Daddy Mommy Grandpa Grandma".Split())Write(string.Concat(Enumerable.Repeat(i+" Shark doo doo doo doo doo doon",3))+i+" Shark!n");
Try it online!
$endgroup$
C# (Visual C# Interactive Compiler), 153 bytes
foreach(var i in"Baby Daddy Mommy Grandpa Grandma".Split())Write(string.Concat(Enumerable.Repeat(i+" Shark doo doo doo doo doo doon",3))+i+" Shark!n");
Try it online!
answered 37 mins ago
Embodiment of IgnoranceEmbodiment of Ignorance
980119
980119
add a comment |
add a comment |
$begingroup$
cQuents, 93 89 bytes
|
#20&bk)~" Shark"~(" doo"6,Z,Z,bk)~" Shark!"
:"Baby","Daddy","Mommy","Grandpa","Grandma"
Try it online!
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
$endgroup$
add a comment |
$begingroup$
cQuents, 93 89 bytes
|
#20&bk)~" Shark"~(" doo"6,Z,Z,bk)~" Shark!"
:"Baby","Daddy","Mommy","Grandpa","Grandma"
Try it online!
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
$endgroup$
add a comment |
$begingroup$
cQuents, 93 89 bytes
|
#20&bk)~" Shark"~(" doo"6,Z,Z,bk)~" Shark!"
:"Baby","Daddy","Mommy","Grandpa","Grandma"
Try it online!
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
$endgroup$
cQuents, 93 89 bytes
|
#20&bk)~" Shark"~(" doo"6,Z,Z,bk)~" Shark!"
:"Baby","Daddy","Mommy","Grandpa","Grandma"
Try it online!
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
edited 31 mins ago
answered 43 mins ago
StephenStephen
7,32823295
7,32823295
add a comment |
add a comment |
ReverseCold is a new contributor. Be nice, and check out our Code of Conduct.
ReverseCold is a new contributor. Be nice, and check out our Code of Conduct.
ReverseCold is a new contributor. Be nice, and check out our Code of Conduct.
ReverseCold is a new contributor. Be nice, and check out our Code of Conduct.
If this is an answer to a challenge…
…Be sure to follow the challenge specification. However, please refrain from exploiting obvious loopholes. Answers abusing any of the standard loopholes are considered invalid. If you think a specification is unclear or underspecified, comment on the question instead.
…Try to optimize your score. For instance, answers to code-golf challenges should attempt to be as short as possible. You can always include a readable version of the code in addition to the competitive one.
Explanations of your answer make it more interesting to read and are very much encouraged.…Include a short header which indicates the language(s) of your code and its score, as defined by the challenge.
More generally…
…Please make sure to answer the question and provide sufficient detail.
…Avoid asking for help, clarification or responding to other answers (use comments instead).
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f179998%2fsing-baby-shark%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
$begingroup$
Is a newline between each stanza (each shark) acceptable? (That's always how I've seen the lyrics written)
$endgroup$
– Quintec
1 hour ago