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
9 int up[15], down[15], rows[8], x[8];
16 for (i = 0; i < 15; i++)
18 for (i = 0; i < 8; i++)
28 for (r = 0; r < 8; r++)
29 if (rows[r] && up[r-c+7] && down[r+c]) {
30 rows[r] = up[r-c+7] = down[r+c] = 0;
36 rows[r] = up[r-c+7] = down[r+c] = 1;
44 for (k = 0; k < 8; k++) {
45 printf("%c", x[k]+'1');