#define N 10 #define FREE N int row[N]; int down[2*N]; int up[2*N]; int top; // Top of the trail stack int qu[N]; 2lp_main() { int count; count = 0; find_all { initial_markings(); solve_queens(); count = count + 1; } printf("The number of solutions found is %d\n",count); } initial_markings() { and(int k=0;k=j;k--) // Untrail label(qu[k],k,FREE); check_free(i,j); //Check row i and diagonals label(i,j,j); // Place j in row i qu[j] = i; // Trail this fact top = j; // Advance top of trail stack } } output() { and(int i=0;i