move_piece: Move a Piece

Description Usage Arguments Value Author(s)

View source: R/move_piece.R

Description

Given a board state and a piece location and its desired new location, updates the board state. Note that if the piece is not found in its start_square, the board is not updated.

Usage

1
move_piece(board, start_square, end_square)

Arguments

board

A 12 by 64 board binary matrix.

start_square

A valid square name, from "a1" to "h8", containing the piece to-be-moved current location.

end_square

The A valid square name, from "a1" to "h8", containing the piece to-be-moved desired new location.

Value

An updated board if the move is valid, or the same board if not.

Author(s)

Eduardo Kapp


eduardokapp/chessR documentation built on Dec. 20, 2021, 3:20 a.m.