International Obfuscated C Code Contest

from Wikipedia, the free encyclopedia

The International Obfuscated C Code Contest (short IOCCC ) is a programming contest for the most creative obfuscated C - programs (ger .: to obfuscate . Lat obfuscare , dt .: darken ). It was held annually from 1984 to 1996 and then at irregular intervals.

The C programming language is actually very structured and largely typified, but gives the programmer a great deal of freedom with regard to the way in which the source text should be structured. In addition, the so-called preprocessor allows text modules to be replaced by other text parts using so-called macros before the actual translation step. These freedoms allow the semantically identical source code to be represented by a large number of different actual source texts, including those that are completely incomprehensible or confusing. So you can easily assign the value “false” to the keyword “true” for “true” and vice versa. If IT projects are not based on a clean structure or if the programmers are inexperienced, incomprehensible and, in particular, unmaintainable programs can arise unintentionally. The task in the not very serious competition is to intentionally write such code.

Each year the entries are presented in numerous categories such as B. Worst Abuse of the C preprocessor (dt .: übelster abuse of the C preprocessor ) or Most Erratic Behavior (dt .: unberechenbarstes behavior ) Prices awarded.

The IOCCC was initiated by Landon Curt Noll and Larry Bassel when they were talking about the awful code they had to maintain professionally. They decided to hold a competition for the worst possible C code. However, within the limitation of the source code size to a few kilobytes , the contestants manage to do complicated things.

Some quotes from the 2004 winners:

  • To keep things simple, I have avoided the C preprocessor and tricky statements such as "if", "for", "do", "while", "switch", and "goto". (Eng .: For the sake of simplicity, I have avoided the C preprocessor and tricky statements such as "if", "for", "do", "while", "switch" and "goto".)
  • We still aren't sure whether or not this is a useful program, but it's the first atomic fission we've seen in the IOCCC. (Eng: We're still not sure if this is a useful program or not, but it's the first nuclear fission we've seen in the IOCCC.)
  • Why not use the program to hide another program in the program? It must have seemed reasonable at the time. (Eng .: Why not use the program to hide another program in the program? It must have seemed sensible at the time.)
  • The program implements an 11-bit ALU in the pre-processor. (Eng .: The program implements an 11-bit ALU in the preprocessor.)
  • I found that calculating prime numbers up to 1024 makes the program include itself over 6.8 million times. (German: I found out that when calculating prime numbers up to 1024, the program uses itself over 6.8 million times.)

A typical competition entry (by Brian Westley, 1988, slightly adapted for compatibility with today's C compilers):

 #define _ F-->00||F-OO--;
 int F=00,OO=00;main(){F_OO();printf("%1.3f\n",4.*-F/OO/OO);}F_OO()
 {
             _-_-_-_
        _-_-_-_-_-_-_-_-_
     _-_-_-_-_-_-_-_-_-_-_-_
   _-_-_-_-_-_-_-_-_-_-_-_-_-_
  _-_-_-_-_-_-_-_-_-_-_-_-_-_-_
  _-_-_-_-_-_-_-_-_-_-_-_-_-_-_
 _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
 _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
 _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
 _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
  _-_-_-_-_-_-_-_-_-_-_-_-_-_-_
  _-_-_-_-_-_-_-_-_-_-_-_-_-_-_
   _-_-_-_-_-_-_-_-_-_-_-_-_-_
     _-_-_-_-_-_-_-_-_-_-_-_
         _-_-_-_-_-_-_-_
             _-_-_-_
 }

This program calculates the circle number Pi using its own area; a more precise value is obtained by using a program version with a larger circular area.

Typical for the submissions are u. a .:

  • The layout of the source text, e.g. B. how an ASCII image (see the circle example above) was formatted
  • Preprocessor redefinitions to make the source code even more difficult to decipher
  • self-modifying program code
  • The competition category worst abuse of the rules (dt .: übelster abuse of the competition rules ): In many years, each filed at least one contribution, which was so obviously absurd that a new version of the rules was required for the next competition. This price is understandably very popular. An example is what is probably the smallest quine in the world: The contribution was a program of length zero, which output zero bytes when executed (i.e. its own program code). The compilation of the program required some creative misuse of the Makefile .

The nature of the competition resulted in programs which were on the edge of the C standards or which could only be compiled via the compiler's rarely used execution paths. As a result, many older competition entries cannot be translated using a modern compiler and some even cause compiler crashes.

Other programming languages

The IOCCC is supposed to be fun, educational and educational, so similar competitions have been launched for programmers of other programming languages:

programming language competition
Erlang Obfuscated Erlang / OTP Competition
Pearl Obfuscated Perl Contest
Ruby Obfuscated Ruby Contest

Web links

Individual evidence

  1. www0.us.ioccc.org