print_board: Print a chessboard in the conventional orientation

View source: R/print_board.R

print_boardR Documentation

Description

Prints a chessboard with the rows arranged bottom to top.

Usage

print_board(board, pov = "white")

Arguments

board

An 8x8 matrix representing a chessboard. See fen_to_board() for details of the board representation.

pov

(Default = 'white') A string indicating which side's point of view should be shown. Allowed values are 'black' and 'white'.

Details

The conventional orientation of a 2-D chessboard places row 1 at the bottom from white's point of view. R's print() function prints matrices with row 1 at the top, causing chessboard rows to appear in reverse order, resulting in a mirror image of the board. The print_board() function simply a wrapper for print() that modifies the board before printing to give a true image of the board.

Value

Prints a chessboard in the correct orientation.

Examples

board <- fen_to_board()$board
print_board(board)

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