powered by
Takes in input a move, evaluates whether it is legal, and if it is, then the game is updated
chess_move(game, piece, initialposition = "", finalposition = "")
makes move
chess game object (i.e., a list with elements board, turn, history, and fen_history as created by newgame function)
letter indicating the piece to be moved (p, N, B, R, Q, K)
initial square of the piece
destination square
newgame() |> chess_move("N", "g1", "f3")
Run the code above in your browser using DataLab