print_board: Pretty print a sudoku board

View source: R/print_board.R

print_boardR Documentation

Pretty print a sudoku board

Description

This function prints a 9 by 9 sudoku board in a way that is appealing to the eye, rather than an R matrix.

Usage

print_board(board)

Arguments

board

A sudoku board/grid.

Value

board (invisibly)

Examples

# sample board:
board <- matrix(data =
                 c(5, 6, 0, 8, 4, 7, 0, 0, 0,
                   3, 0, 9, 0, 0, 0, 6, 0, 0,
                   0, 0, 8, 0, 0, 0, 0, 0, 0,
                   0, 1, 0, 0, 8, 0, 0, 4, 0,
                   7, 9, 0, 6, 0, 2, 0, 1, 8,
                   0, 5, 0, 0, 3, 0, 0, 9, 0,
                   0, 0, 0, 0, 0, 0, 2, 0, 0,
                   0, 0, 6, 0, 0, 0, 8, 0, 7,
                   0, 0, 0, 3, 1, 6, 0, 5, 9
                 ),
               ncol = 9)
print_board(board)

KennedyMwavu/SudokuR documentation built on Jan. 2, 2023, 9:07 p.m.