37
6
Puzzle:
Write a short, three-line program which:
- has 5/7/5 syllables per line when read aloud
- outputs a haiku when run.
An example of a program having the correct structure, but non-haiku output, is (Python):
>>> for x in range(3):
... print "EXTERMINATE HUMANS"
... # I am a Dalek.
...
EXTERMINATE HUMANS
EXTERMINATE HUMANS
EXTERMINATE HUMANS
(The comment is a bit of a cop-out.)
This reads aloud as:
for x in range three
print EXTERMINATE HUMANS!
I am a Dalek.
Any language is acceptable. For the purposes of reading aloud, symbols like !@#$%^&*()_+
can be ignored if you want, or pronounced aloud, admitting something like Waka Waka Bang Splat. (I'm sure there will be a Perl entry like !***(!:, )(*@@@#, )_(*)!.
)
Extra points if either the code or the output is especially funny, or especially zen.
Edit: If your language requires boilerplate before it can do anything interesting (#include <iostream>
?) then I'm happy to ignore the boilerplate.
I've accepted Paul Richter's Common Lisp haiku on the grounds that it made me laugh for a good five minutes.
Honorable mention for Timwi's creative rule-bending (compiler output?!) and for the extremely memorable line "Static void. I long for you."
Now this question ends;
Many more haikus await.
Continue posting!
I would strongly suggest you prevent the use of cat-like languages... – MrZander – 2012-05-08T22:08:47.207
1"Dalek Simulator" is 6 syllables (or maybe "# Dalek Simulator" is 7 syllables ?) - either way, shouldn't it be 5 syllables for the third line ? – Paul R – 2012-05-09T08:12:16.203
@PaulR: You're right. Edited to something that's 5 syllables. ;) – Li-aung Yip – 2012-05-09T08:50:50.687
1Bonus to a Piet solution? – ugoren – 2012-05-09T12:59:57.813
1@ugoren: If you can make a Piet program look like a haiku, I'm pretty sure that would win the Grand Prize. ;) – Li-aung Yip – 2012-05-10T01:18:38.540
I though about adding "haiku outputting haiku" to the sandbox, but searched first... – Vi. – 2014-09-02T10:24:53.640