pig_latin


pig_latin, a C code which converts an input file of English text into a file of "Pig Latin" text, using a very obscure programming style, by Don Dodson.

The program was the winner, in the "Most Humorous" category, of the annual International Obfuscated C Code Contest (IOCCC) - a contest you only want to win on purpose!

To see why it was a winner, print out the code. Look at it. Look at it a long time. Realize that the C compiler sees nothing wrong with this code, and can compile it into a program that really does what it says it will do.

As the author says:

"Istha ogrampra akesta Englishwa extta aswa inputwa andwa anslatestra itwa intowa Igpa Atinla."

The obfuscation is on several levels.

Most obviously, the shape of the program.

Underneath that, the variable names are in Pig Latin, as are the names of the standard C functions, such as >putchar. Even main is written as ainma.

The program construction is also very obfuscated, with all of the code being inside the parentheses of one of the 6 orfa loops.

Usage:

        pig_latin < input > output
      
will read the text of input, convert it to Pig Latin, and write the converted text to output.

Licensing:

The computer code and data files described and made available on this web page are distributed under the MIT license

Languages:

pig_latin is available in a C version.

Related Data and Programs:

CAESAR, a C code which can apply a Caesar Shift Cipher to a string of text.

MANDELBROT_ASCII, a C code which generates an ASCII image of the Mandelbrot fractal set using just two lines of C.

mgs, a C code which is an example of obscure legacy code, which the student is encouraged to study, understand, and document. This example is due to Diane O'Leary.

pig_latin_test

ROT13, a C code which reads a file of text and converts it to ROT13 text, and vice versa.

UUDECODE, a C code which reads a UU encoded text file and translates it back to its original form.

UUENCODE, a C code which translates a file (possibly in binary format) to the UU encoding.

Author:

Don Dodson

Reference:

Ebsterway's Ictionaryday

Source Code:


Last revised on 24 July 2019.