help me with the program



N-Queens :
You are given a N x N chessboard & you are required to place N queens
on it so that they can't attack each-other. You just need to find out
the valid positions of the queens and the total number of such valid
combinations. A sample I/p and o/p is given below (where N will be
input by the user).

Sample I/p :
Enter the no. of queens: 4
Sample o/p:
1,3,0,2
2,0,3,1
Total no. of possible combinations = 2

Explanation: In the aforesaid example 4 is the value of N input by the
user(4 x 4 chessboard & 4 queens). The o/p prints the position no.s of
the four queens on the chessboard on screen (position no.s can have
value from 0 to N-1, refer the figure below).

0 1 2 3
- Q - -
- - - Q
Q - - -
- - Q -

The second line shows next such valid combination. Finally it prints
the total no. of such valid combinations on screen.

.



Relevant Pages

  • Re: Need help with font selection
    ... display a chessboard with several queens on it. ... html table and the queens are represented by the character '*'. ... internet and found a set of free chess fonts. ...
    (alt.html)
  • Re: Need help with font selection
    ... display a chessboard with several queens on it. ... html table and the queens are represented by the character '*'. ... My problem is that I don't know how to select the queen character from ... All I'm asking is for a code example of how do I display the queen ...
    (alt.html)
  • Need help with font selection
    ... For a chess puzzle that I'm working on at the moment, ... display a chessboard with several queens on it. ... html table and the queens are represented by the character '*'. ... internet and found a set of free chess fonts. ...
    (alt.html)
  • Question on min_max
    ... Eclipse, trying to put n queens on a chessboard and maximize the ... unattacked positions. ...
    (comp.lang.prolog)