Here are all possible UCI strings and here is the code to generate them.Check price here The Chessboard Layout With Namesįirst, you have to be familiar with the chessboard set-up. # 2 players, 14 diagonals (12 in the center and 1 each in the first and last ranks), 4 choicesĬastling is assumed to be indicated by moving the king two steps. # Diagonal pawn promotions, when capturing a piece # Straight pawn promotions, 2 players, 8 ranks each, 4 choices (queen, rook, bishop, knight) Moves += len(list(board.generate_legal_moves()))īt_piece_at(chess.square(x,y), chess.Piece(chess.KNIGHT, chess.WHITE)) # Pythonīt_piece_at(chess.square(x,y), chess.Piece(chess.QUEEN, chess.WHITE)) If the board is given and only the source and target square, as well the promotion choice are considered (as in the UCI format), then it appears there will be 1968 possible moves. One could raise the number even higher by distinguishing moves that give check or even checkmate, or by distinguishing captures according to the piece captured. In summary, the most generous way of counting possible moves might lead to 1684 + 3584 + 2240 + 5824 + 1344 + 440 = 15116 distinct moves. Again, at least for pawns it seems useful to distinguish by player and arrive at 440. If you want to distinguish capture en passant from a normal capture by the same movement (start and end field) of the pawn, add 14 to arrive at 220. This gives us 70 capture moves from rows 2 to 6, plus 56 capture with promotion. For pawns, we must distinguish captures: In only seven of the eight columns, we can capture to the right, and in seven of eight columns we can capture to the left. It can move ahead from row 7 and promote to queen, rook, bishop, or knight (32 moves). It can move one ahead from rows 2 to 6 (40 moves). Double again (1344) if you distinguish by colour.Ī white pawn can move two fields ahead from its initial position (8 moves). Double (672) if you distinguish captures. We have the same number 42 (though with different fields) for all eight directions, hence a total of 336 knight moves. It is easier to count by direction: There are 42 (6 by 7) fields from where we can go two to the right and one up, say. The knight can typically make 8 moves, but as with the king we have to account for nearby boundary. Double (1120) if you want to distinguish captures, double once more (2240) if you want to distinguish by colour.įor the queen simply add rook and bishop, thus counting 1456, 2912, or 5824 moves. Sum over n=1,2,3,4,5,6,7,8,7,6,5,4,3,2,1 (i.e., ignoring the colour of the bishop) to arrive at 280 moves, double to 560 to count both diagonal directions. On a diagonal (NW to SE, say) of length n, a bishop can make n( n-1) moves (pick a start field and a distinct end field). Double again (3584) if you want to distinguish colour. Double to 1792 if you distinguish captures. Now allow for the black king to double this (1684)? Or identify moves they could both make (i.e., all but castling - 844)?Ī rook can always (given free line of sight) move to 14 squares. If you distinguish captures, this almost doubles (castling can't capture) to 842. That's 420 moves for the white king, add 2 for castlings to arrive at 422. The white king can move to 8 fields from the inner 36 fields, to 4 fields from the 4 corner fields and to 5 fields from the remaining 24 boundary fields.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |