board_to_int: Convert chessboard characters to integers

View source: R/board_to_int.R

board_to_intR Documentation

Convert chessboard characters to integers

Description

This function takes an 8x8 character matrix of a chessboard and converts letter representations of pieces into integers, with black pieces indicated using a - sign.

Usage

board_to_int(board)

Arguments

board

A character matrix representing a chessboard.

Details

The board is converted to the same format used by is_check_cpp(). 1 = pawn 2 = bishop 3 = knight 4 = rook 5 = queen 6 = king

Value

An integer matrix with the same dimensions as the input, where chess pieces have been converted to integers.

Examples

board <- fen_to_board()
int_board <- board_to_int(board$board)


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