I started to learn the language C in the Summer of 1993. After my first course in the Pascal Programming Language. My first book which I had contact was C Programming Language by K & R.
With the passage of time had contact with the literature of other authors such as Herbert Schildt, Kris Jamsa, Chris H. Pappas & William H Murray, Ted Faison.
For years I had seen the term "obfuscated programming in C " in the C programming books, During the Summer of 2002 when I taugh the Systems Programming Course (Design Compiler). In-depth study of recursive descendent grammars, I began to read the works of Dennis Ritchie and Ken Thompson.
Some day when i visited the Website of Ken Thompson ( http://cm.bell-labs.com/who/ken/trust.html ) I read this..."As a programmer, I write programs. I would like to present to you the cutest program I ever wrote. I will do this in three stages and try to bring it together at the end. In college, before video games, we would amuse ourselves by posing programming exercises. One of the favorites was to write the shortest self-reproducing program."
Something that caught my attention; then I read again all the books about:
- Compiler Design.
- Language Grammars.
- Programmig Languages.
- Structured Programming.
Books that could help me to explane How to write complex expressions and sentences with the Grammar of C. Authors always share something about contest obfuscated programming in C in their books.
This was the first time I had contact with this intereresante term programming. Make a program that prints itself, How? I had never tried to do something like that. Then compiler and books in hand started to decipher it.
The International Obfuscated C Code Contest
http://www.nyx.net/~gthompso/quine.htm
Example of Code in C (Self-Reproducing Program)
//
{char *c="main(){char *c=%c%s%c;printf(c,34,c,34);}";printf(c,3>4,c,34);}
//
- To write the most Obscure/Obfuscated C program within the rules.
- To show the importance of programming style, in an ironic way.
- To stress C compilers with unusual code.
- To illustrate some of the subtleties of the C language.
- To provide a safe forum for poor C code. :-)
