chess_move {chess2plyrs} | R Documentation |
chess_move
Description
Takes in input a move, evaluates whether it is legal, and if it is, then the game is updated
Usage
chess_move(game, piece, initialposition = "", finalposition = "")
Arguments
game |
chess game object (i.e., a list with elements board, turn, history, and fen_history as created by newgame function) |
piece |
letter indicating the piece to be moved (p, N, B, R, Q, K) |
initialposition |
initial square of the piece |
finalposition |
destination square |
Value
makes move
Examples
newgame() |>
chess_move("N", "g1", "f3")
[Package chess2plyrs version 0.3.0 Index]