Code Wars II
Danger Level: Green (Bunny Slope)
Point Value: 2
Some programmers absolutely refuse to write code that others can easily understand, or to write documentation for their programs. Sometimes these people are called unemployed. However, there is a safe outlet for those who wish to express themselves by writing really awful code. It's called the International Obfuscated C Code Contest, or IOCCC (see http://www.ioccc.org). The goals of the contest are:
You should compile the following program. This was the 1990 winner of the Best Small Program award. When you run the program it will wait for a single integer input from the keyboard before execution. Try using numbers between 4 and 8.
The program displays a solution for the N-queens problem, where N is the integer taken from the input line. But the real "output" from this exercise is, as one of the contest goals states, to show the importance of programming style, in an ironic way.
Program Copyright (c)
1990, Landon Curt Noll & Larry Bassel. All Rights Reserved.
Permission for personal, educational or non-profit use is granted provided
this this copyright and notice are included in its entirety and remains
unaltered. All other uses must receive prior permission in writing
from both Landon Curt Noll and Larry Bassel.