Problem #1

Code Wars II
Danger Level: Green (Bunny Slope)



}Eschew Obfuscation~

Point Value: 2

Problem Statement

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:

Program Input

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.

int v,i,j,k,l,s,a[99]; main() {
 for(scanf("%d",&s);*a-s;v=a[j*=v]-a[i],k=i<s,j+=(v=j<s&&(!k&&!!
   printf(2+"\n\n%c"-(!l<<!j)," #Q"[l^v?(l^j)&1:2])&&++l||a[i]<s&&v&&
   v-i+j&&v+i-j))&&!(l%=s),v||(i==j?a[i+=k]=0:++a[i])>=s*k&&++a[--i])
  ;
}

Program Output

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.