Code: Select all
public short Search()
{
short score = Evaluation.Compute(board);
short depth = 0;
while (depth++ < maxSearchDepth)
{
short alpha = (short)(score - Constants.ALPHA_BETA_WINDOW);
short beta = (short)(score + Constants.ALPHA_BETA_WINDOW);
score = Search(alpha, beta, depth);
if (score <= alpha)
{
alpha = -Constants.INFINITE_WINDOW;
score = Search(alpha, beta, depth);
}
else if (score >= beta)
{
beta = Constants.INFINITE_WINDOW;
score = Search(alpha, beta, depth);
}
Uci.Info(depth, score, nodes, PV.Moves[0]);
}
return score;
}
Here is the output I captured from one of my tests:
Code: Select all
info depth 1 score cp 137 nodes 21 nps 3000 time 7 pv e2e4
info depth 2 score cp 0 nodes 174 nps 17400 time 10 pv d2d4 d7d5
info depth 3 score cp 116 nodes 2579 nps 117227 time 22 pv d2d4 d7d5 g1f3
info depth 4 score cp 15 nodes 18890 nps 178207 time 106 pv e2e4 e7e5 d2d4 e5d4 d1d4
info depth 5 score cp 106 nodes 159321 nps 398302 time 400 pv d2d4 d7d5 g1f3 g8f6 c1f4
info depth 6 score cp 4 nodes 1104873 nps 764089 time 1446 pv d2d4 d7d5 e2e4 d5e4 f1b5 c7c6 b5c4
If anyone has any suggestions about how to test a new engine, I would love to hear them. I still need to get UCI complete wired up and implement time controls. I also don't have checkmate or stalemate checking complete correct yet so I know I can't play a game yet, but it's a start.