gawk: Signature Program
1
1 11.3.11 And Now for Something Completely Different
1 --------------------------------------------------
1
1 The following program was written by Davide Brini and is published on
1 his website (http://backreference.org/2011/02/03/obfuscated-awk/). It
1 serves as his signature in the Usenet group 'comp.lang.awk'. He
1 supplies the following copyright terms:
1
1 Copyright (C) 2008 Davide Brini
1
1 Copying and distribution of the code published in this page, with
1 or without modification, are permitted in any medium without
1 royalty provided the copyright notice and this notice are
1 preserved.
1
1 Here is the program:
1
1 awk 'BEGIN{O="~"~"~";o="=="=="==";o+=+o;x=O""O;while(X++<=x+o+o)c=c"%c";
1 printf c,(x-O)*(x-O),x*(x-o)-o,x*(x-O)+x-O-o,+x*(x-O)-x+o,X*(o*o+O)+x-O,
1 X*(X-x)-o*o,(x+X)*o*o+o,x*(X-x)-O-O,x-O+(O+o+X+x)*(o+O),X*X-X*(x-O)-x+O,
1 O+X*(o*(o+O)+O),+x+O+X*o,x*(x-o),(o+X+x)*o*o-(x-O-O),O+(X-x)*(X+O),x-O}'
1
1 We leave it to you to determine what the program does. (If you are
1 truly desperate to understand it, see Chris Johansen's explanation,
1 which is embedded in the Texinfo source file for this Info file.)
1