board_to_int | R Documentation |
This function takes an 8x8 character matrix of a chessboard and converts letter representations of pieces into integers, with black pieces indicated using a - sign.
board_to_int(board)
board |
A character matrix representing a chessboard. |
The board is converted to the same format used by is_check_cpp()
.
1 = pawn
2 = bishop
3 = knight
4 = rook
5 = queen
6 = king
An integer matrix with the same dimensions as the input, where chess pieces have been converted to integers.
board <- fen_to_board()
int_board <- board_to_int(board$board)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.