update_board: Update a chessboard to show the position after a move is made

View source: R/update_board.R

update_boardR Documentation

Update a chessboard to show the position after a move is made

Description

This function updates a chessboard to show the position after a move is made. It returns a list containing the updated board and the status of the game. See fen_to_board() for details of the board format.

Usage

update_board(move, board)

Arguments

move

A single-element character vector consisting of a legal chess move in UCI long algebraic notation.

board

A list where the first element is a matrix representing the chessboard, and the remaining 5 elements are the same as in a FEN string.

Value

A list containing the updated board and status. The list names should be board, to_move, castling_rights, ep_target, halfmove_clock, and fullmove_number.

Examples

board <- fen_to_board()
move <- 'e2e4'
update_board(move, board)

dryguy/rbitr documentation built on Oct. 15, 2024, 6:18 a.m.