board.MakeMove is giving an issue even tho it gets its moves from GetLegalMoves
JoelSjoberg123 opened this issue · comments
JoelSjoberg123 commented
int Search(Board board, Move move, Timer timer, int iterations, bool myTurn)
{
//This is the only place where Make- and UndoMove are used right now
board.MakeMove(move);
Move[] moves = board.GetLegalMoves();
//call itself and evaluate
board.UndoMove(move);
return bestScore;
}
Mishka commented
Make sure you aren't exiting the search function before undoing the move, e.g. if you are cheking for mate in one and returning that move before doing the rest of the evaluation and then undoing the move
JoelSjoberg123 commented
That was close, but it wasn't in the checmate stuff. It was something else in the evaluate where I forgot to undomove.