wpl@burdvax.UUCP (William P Loftus) (04/03/86)
Those of you who follow the net.lang.c or net.unix-wizards newgroups, might know the time is nearing for the annual Obfuscated C Code Contest, already in its third year. Well, anouncing the annual **Obfuscated Ada Code Contest**! With validated Ada compilers proliferating though industry like wildfire, the craze has started to become one of the few real 'Ada hackers'. We're talking REAL men here. For those of you who aren't familiar with the Obfuscated C Code Contest, the idea is to create the most visually disgusting and semantically confusing program as possible. One thing I can say about those C guys is that they sure can write ugly programs! As fun as it is, and it is fun, it's still pretty much an exercise in lexical creativity. Any reasonably good C pretty printer spoils the whole thing. Because Ada is a REAL lanague, we would certainly need a REAL contest to sharpen our skills on. The Rules 1) The program should compile at least on MOST validated Ada compilers. 2) People should submit a listing of their program (showing that is compiles) and the output (if any). 3) One submition per person. 4) The contest starts NOW and ends May 30th 1986. The Judges 1) William Loftus, SDC ...!burdvax!wpl 2) Eric Marshall, SDC ...!burdvax!eric Mail programs (listing and output) to burdvax!wpl. The REAL men at SDC: William Loftus & Eric Marshall ----------------------- The above should not be thought of at all (not even a little bit) as a reflection of the views, attitudes, or anything else of SDC. In fact these ideas are really the wooden elephant that stands on my desk!
markb@sdcrdcf.UUCP (Mark Biggar) (04/04/86)
As a possible aid to those entering this contest, I am posting the specification of an Ada ugly-printer program. This proposal is brought to you by Larry Wall, Mark and Jon Biggar (the western branch of REAL men at SDC). We wrote this about 2 years ago. ------------------------------- PROPOSAL FOR UGLY-PRINTER APSE TOOL Purpose: To render an Ada program unreadable by anything except a compiler. Function: The Ada ugly-printer should do the following: -- remove all unnecessary spaces. -- remove or displace meaningful comments, and insert spurious comments, preferably containing Ada code or text which appears to be meaningful. -- insert spurious pragmas which will be ignored by the compiler. -- insert lots of null statements. -- say "with UNCHECKED_CONVERSION, UNCHECKED_DEALLOCATION" in front of all program units, whether used or not. -- fill up lines most of the time, but occasionally do a section with newlines between every token. -- make lines longer than a screen width, if the compiler will handle it. -- most of the time, replace " with %, # with :, and | with !. -- for numeric literals, use based, exponential notation with random bases, preferably not base 2, 8, 10, or 16. Whenever possible use fractions rather than negative exponents. -- insert underlines randomly in numeric literals. -- insert one or more extra sets of parentheses around most literals, whether numeric, string, or aggragate. -- randomly intermix upper and lower case in identifiers and keywords. -- write all strings as concatenations and/or aggragates (in random, named notation). If the ugly-printer is capable of parsing and maintaining a symbol table, the following may also be done: -- change all infix operators to functional notation, with named operands in reverse order, especially for non-symmetrical operators. -- scramble named notations, perhaps making some positional. -- rename items to meaningless names, and use those names. -- throw in unused labels. Mark Biggar {allegra,burdvax,cbosgd,hplabs,ihnp4,akgua,sdcsvax}!sdcrdcf!markb