75
9
Rock-and-roll founding father Chuck Berry sadly passed away today.
Consider the chorus of his famous song "Johnny B. Goode":
Go, go
Go Johnny go, go
Go Johnny go, go
Go Johnny go, go
Go Johnny go, go
Johnny B. Goode
(There are other ways it has been punctuated but the above will serve for the purposes of the challenge.)
Challenge
Given a nonempty, lowercase string of letters a-z, output the chorus of "Johnny B. Goode" with all the instances of Go
or go
replaced with the input string, capitalized in the same way.
A trailing newline may optionally follow. Nothing else in the chorus should change.
For example, if the input is
code
the output must be exactlyCode, code Code Johnny code, code Code Johnny code, code Code Johnny code, code Code Johnny code, code Johnny B. Codeode
optionally followed by a newline.
Note that the capitalization of all words matches the original chorus, and (despite lack of rhythm) the Go
in Goode
is replaced as well as the individual words Go
and go
.
The shortest code in bytes wins.
Test Cases
"input"
output
"go"
Go, go
Go Johnny go, go
Go Johnny go, go
Go Johnny go, go
Go Johnny go, go
Johnny B. Goode
"code"
Code, code
Code Johnny code, code
Code Johnny code, code
Code Johnny code, code
Code Johnny code, code
Johnny B. Codeode
"a"
A, a
A Johnny a, a
A Johnny a, a
A Johnny a, a
A Johnny a, a
Johnny B. Aode
"johnny"
Johnny, johnny
Johnny Johnny johnny, johnny
Johnny Johnny johnny, johnny
Johnny Johnny johnny, johnny
Johnny Johnny johnny, johnny
Johnny B. Johnnyode
"fantastic"
Fantastic, fantastic
Fantastic Johnny fantastic, fantastic
Fantastic Johnny fantastic, fantastic
Fantastic Johnny fantastic, fantastic
Fantastic Johnny fantastic, fantastic
Johnny B. Fantasticode
46Missed opportunities for test cases:
an
,c
,cath
– Neil – 2017-03-19T10:08:47.09354Somebody please do a Go version. – jl6 – 2017-03-19T10:59:42.970
2How should the program handle multi-word strings? – Comrade SparklePony – 2017-03-19T17:54:49.983
6Let's just observe a minute or two of silence, and wish Rest In Peace to Chuck. – Erik the Outgolfer – 2017-03-19T19:51:34.623
@SparklePony The input only contains letters so it will only be one "word" as far as the program knows. – Calvin's Hobbies – 2017-03-19T21:03:21.820
What about coding the card game? https://boardgamegeek.com/thread/1156670/rules-explanation-rather-simple-go-johnny-go-go-go
– Mawg says reinstate Monica – 2017-03-20T09:18:49.1971
The code text sounds best when spoken by Google Translator in Spanish: https://translate.google.com/#es/en/Code%2C%20code%0ACode%20Johnny%20code%2C%20code%0ACode%20Johnny%20code%2C%20code%0ACode%20Johnny%20code%2C%20code%0ACode%20Johnny%20code%2C%20code%0AJohnny%20B.%20Codeode
– palsch – 2017-03-22T18:33:59.980Simple method, Original poem with [tag:kolmogorov-complexity] skills, then swap Go with input – Matthew Roh – 2017-03-23T07:45:49.080