I am presently building a chess gaem.. the game details are on the other thread.. you can download my game(begining stages)
The inteface and validation will take me another 15 days.. Then i have to build a single player game into it.. That is computer v/s player...
So do you know any backtracking or any other algorithm which will make the computer decide the best move... I have represented my board in an 1 dimensional array of 64.. And it holds the entire state of the board.. 0 if the cell is empty. 1 for a white king , 2 for a bishop etc etc...
Thanx in advance..
The easiest and I guess also best way is to use a brute force algorithm that looks at every possible sequence of moves and then picks one that ends at the solution, but unfortunatly an average computer will probably require too much memory and time to do the calculations.
they have some ideas here