If you’ve been following along, you probably have seen that the king had a slight problem. It was failing to adequately check for pawns when considering it’s own safety.

Here you can see the commit where I fixed the code. Now it will accurately check for a pawn attack in the space it is moving to!

 + try {
 + if (“p”.equals(chessBoard[kingPositionC/8+(-1)][(kingPositionC%8)+1])) {
 + return false;
 + }
 + if (“p”.equals(chessBoard[kingPositionC/8+(-1)][kingPositionC%8+(-1)])) {
 + return false;
 + }
 + } catch (Exception e) {}

I also added a TextView display to show the user how long the computer took to “think” about the last move. It helps to know how much time the computer is spending on each move, especially when compared to the number of potential moves available.

Linux – keep it simple.

Leave a Reply

Your email address will not be published. Required fields are marked *