comp.lang.ada
 help / color / mirror / Atom feed
From: markb@sdcrdcf.UUCP (Mark Biggar)
Subject: Re: Annual Obfuscated Ada Code Contest
Date: Fri, 4-Apr-86 15:35:24 EST	[thread overview]
Date: Fri Apr  4 15:35:24 1986
Message-ID: <2738@sdcrdcf.UUCP> (raw)
In-Reply-To: 2425@burdvax.UUCP

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

      reply	other threads:[~1986-04-04 20:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1986-04-03 20:23 Annual Obfuscated Ada Code Contest William P Loftus
1986-04-04 20:35 ` Mark Biggar [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox