2 !!DESCRIPTION!! solves the "8 queens" chess problem
3 !!ORIGIN!! LCC 4.1 Testsuite
4 !!LICENCE!! own, freely distributeable for non-profit. read CPYRIGHT.LCC
7 int up[15], down[15], rows[8], x[8];
14 for (i = 0; i < 15; i++)
16 for (i = 0; i < 8; i++)
26 for (r = 0; r < 8; r++)
27 if (rows[r] && up[r-c+7] && down[r+c]) {
28 rows[r] = up[r-c+7] = down[r+c] = 0;
34 rows[r] = up[r-c+7] = down[r+c] = 1;
42 for (k = 0; k < 8; k++) {
43 printf("%c", x[k]+'1');