Derek Peschel wrote:
There is an April Fool's post in which K&R
admit UNIX was a hoax:
We stopped when we got a clean compile on the following syntax:
for(;P("\n"),R-;P("|"))for(e=C;e-;P("_"+(*u++/8)%2))P("|
"+(*u/4)%2);
To think that modern programmers would try to use a language that
allowed such a statement was beyond our comprehension! We actually
thought of selling this to the Soviets to set their computer science
progress back 20 or more years.
I've wondered about that line for ages. For starters, it has several
typos. I think the corrected version is:
for(;P("\n"),R--;P("|"))for(e=C;e--;P("_
"+(*u++/8)%2))P("| "+(*u/4)%2);
(ie. decrement operator inserted twice, and the underscore needs a space
after it)
As this code does something useful, I can't imagine anyone writing it
just for the sake of a joke, so does anyone know where it came from?