Dec 27, 2006

[Download] Search done

I have now finished the Alpha-Beta search.

It uses a simple evaluation of piece values, and keeps track of mate, stalemate, 50 move draw, and lack of material draw. As I said I will wait with implementing the three-fold repetition draw.

The depth we want to search is for now stored in the Engine-class, called PLY_DEPTH. If we want to search at different depths we need to recompile the Engine-class with a new value for PLY_DEPTH. I will probably change this in the future, but for now it will do.

The Engine-class also uses a small class called LineEval which holds the expected line and an evaluation. With this download I also submitted the Test-class which I have used to try out the search. In it you can see how a call is made to the search after setting up the board with a FEN-string.

To extract the principal variation (the line the engine expects both players will be following) is not a simple matter, and it can be hard to follow how it is done. I will make a post trying to explain it. There are some minor errors in it for now, like showing expected moves after a mate (which is not possible of course). The main thing is the first move is correct though, so the engine knows what to play.

Since the engine is ready to play some mediocre(!) chess now I will implement compability with WinBoard next. By doing this I can easily check if additions to the engine are improvements or not but letting the engine play itself.

Once that is done we can start adding things like iterative deepening, quiescent search and transposition tables. And looking further ahead openings, time management, three-fold repetition and a more advanced evaluation algorithm.


2006-12-27 - Added information about where to change the search depth

No comments: