is_check | R Documentation |
This function returns TRUE if there are checks from enemy pieces, and FALSE otherwise.
is_check(board, color)
board |
An 8x8 matrix representing a chess position. See
|
color |
A string ("white" or "black"), indicating which king to examine. |
TRUE if the king is in check from an enemy piece, FALSE otherwise.
board <- fen_to_board('8/8/8/8/4k3/8/8/8 b - - 0 1')
print(board$board)
is_check(board$board, 'black')
board$board[3, 4] <- 'P'
print(board$board)
is_check(board$board, 'black')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.