Hello everybody! I am trying to write AI Chess and I have a problem. I am ready with pieces movement rules, and I'm trying to remove moves that are not valid (leave the king in check etc). I Wrote something like this:
ValidateMove(board);
{
for(i=0;i<64;i++)
if(board[i]==king.opposite) kingpos=board[i];
createmoves(board);
if (moves.contains(kingpos)) return false;
}
However, I'm using minimax + alpha beta and that validation is making my search really slow.