valid: check if a number can be placed in a certain position.

View source: R/valid.R

validR Documentation

check if a number can be placed in a certain position.

Description

This function checks if the provided number can be placed in the specified row and column in adherence to the rules of the sudoku game.

Usage

valid(board, num, row, col)

Arguments

board

A 9 by 9 sudoku grid

num

A number in 1:9

row

specified row

col

specified column

Value

TRUE or FALSE indicating if placement is valid or not.

Examples

b2 <- sample_boards()[[5]]
valid(b2, 7, 4, 8)

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