50
6
The text of the children's book Polar Bear, Polar Bear, What Do You Hear? has a very simple pattern. You might use the text to teach introductory programming concepts.
My son was quickly bored by this idea, so I decided to play some golf with it instead.
The Challenge
In your programming language of choice, write the smallest program possible which will print the following text. Output should match exactly, including case, spacing, and punctuation.
Polar Bear, Polar Bear, what do you hear?
I hear a lion roaring in my ear.
Lion, Lion, what do you hear?
I hear a hippopotamus snorting in my ear.
Hippopotamus, Hippopotamus, what do you hear?
I hear a flamingo fluting in my ear.
Flamingo, Flamingo, what do you hear?
I hear a zebra braying in my ear.
Zebra, Zebra, what do you hear?
I hear a boa constrictor hissing in my ear.
Boa Constrictor, Boa Constrictor, what do you hear?
I hear an elephant trumpeting in my ear.
Elephant, Elephant, what do you hear?
I hear a leopard snarling in my ear.
Leopard, Leopard, what do you hear?
I hear a peacock yelping in my ear.
Peacock, Peacock, what do you hear?
I hear a walrus bellowing in my ear.
Walrus, Walrus, what do you hear?
I hear a zookeeper whistling in my ear.
Zookeeper, Zookeeper, what do you hear?
I hear children...
...growling like a polar bear,
roaring like a lion,
snorting like a hippopotamus,
fluting like a flamingo,
braying like a zebra,
hissing like a boa constrictor,
trumpeting like an elephant,
snarling like a leopard,
yelping like a peacock,
bellowing like a walrus...
that's what I hear.
6[tag:kolmogorov-complexity] would be a good tag for this – charredgrass – 2016-07-19T04:03:33.167
3Are the uppercase
B
andC
inPolar Bear
andBoa Constrictor
necessary? (In Batch this costs me 10% of my byte count...) – Neil – 2016-07-19T10:15:17.947Is submitting a hash and bruteforcing the solution with a restricted set allowed? :D – polym – 2016-07-19T10:30:17.567
4This is a very nice first challenge! – Alex A. – 2016-07-19T16:24:27.507
Does the null terminator matter? – noɥʇʎԀʎzɐɹƆ – 2016-07-19T21:06:51.197
@AgentCrazyPython I don't think null terminators get output. Do you mean doing it in brainfuck or something, where they do get output? – Erik the Outgolfer – 2016-07-20T14:05:14.523
@EʀɪᴋᴛʜᴇGᴏʟғᴇʀ or newlines – noɥʇʎԀʎzɐɹƆ – 2016-07-20T17:36:08.550
1I'd +1 but you're at 42 upvotes, and who am I to disturb the ways of the galaxy? – FantaC – 2018-02-14T23:06:32.393
@tfbninja, you may now upvote! – Shaggy – 2018-02-16T09:21:46.403
@Shaggy duly noted and upvoted! – FantaC – 2018-02-16T16:05:16.870