chess_move: chess_move

View source: R/chess_move.R

chess_moveR 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")


chess2plyrs documentation built on June 8, 2025, 10:03 a.m.