Le texte du livre pour enfants Polar Bear, Polar Bear, qu'entendez-vous? a un motif très simple. Vous pouvez utiliser le texte pour enseigner les concepts d'introduction à la programmation.
Mon fils s’est vite ennuyé de cette idée, alors j’ai décidé de jouer au golf avec.
Le défi
Dans le langage de programmation de votre choix, écrivez le plus petit programme possible qui imprimera le texte suivant. La sortie doit correspondre exactement, y compris la casse, l’espacement et la ponctuation.
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.
B
et C
dans Polar Bear
et Boa Constrictor
nécessaire? (Dans le lot, cela me coûte 10% de mon nombre d'octets ...)