Thursday, December 13, 2012

Chess engine programming: Analysis of legal moves, plies, and total move combinations of chess pieces


Chess is one of the oldest classic games played on a board. The chess board is an 8 x 8 grid consisting a total of 64 equal squares. Chess is a game of perfect information because each player knows and sees all the moves and all the pieces in the board at all times. On the starting position of the game, White has 8 pawns, 2 rooks, 2 knights, 2 bishops, 1 queen, and 1 king for a total of 16 White pieces. Black on the other hand has exactly the same kinds and quantities of pieces but of the opposite color for a total of 16 Black pieces. With all the White and Black pieces combined, the total number of pieces at the start of the game of chess is 32.

On White's first move, there are a total of 20 legal or valid moves. On Black's first move, there are also a total of 20 legal or valid moves. There are a total of 400 possible move combinations (20 x 20) on each player's first moves. In chess engine programming terminologies, a player's turn is called a ply. Thus, 2 plies mean that White has made a move on his turn and Black has replied a move on Black's turn. Another way to understand a ply is to think that a pair of one White and one Black move equals 2 plies.

White's 20 legal moves on the first move:


Pawn moves
1. a3
2. a4
3. b3
4. b4
5. c3
6. c4
7. d3
8. d4
9. e3
10. e4
11. f3
12. f4
13. g3
14. g4
15. h3
16. h4

Knight moves
17. Nf3
18. Nh3
19. Nc3
20. Na3


Black's 20 legal moves on the first move:


Pawn moves
1. a6
2. a5
3. b6
4. b5
5. c6
6. c5
7. d6
8. d5
9. e6
10. e5
11. f6
12. f5
13. g6
14. g5
15. h6
16. h5

Knight moves
17. Nf6
18. Nh6
19. Nc6
20. Na6

No comments:

Post a Comment