logic1: Function to implement first logical reasoning to find...

Description Usage Arguments Value

Description

This function searches over the i rows and j columns of each kth dimension of the 9x9x9 logical array. It searches for rows and columns where there is only one NA value. If a row or column that meets this criteria is found the function returns the [i, j, k] indicies where it occurs.

Usage

1
logic1(puzList)

Arguments

puzList

a sudokuPuzzle object which contains a 9x9 matrix representation of a sudoku puzzle as the first list element and a 9x9x9 logical array representing the solutions of the sudoku puzzle

Value

The function searches the logical array of the sudokuPuzzle object for new solutions. If a solution is found, the function returns the [i, j, k] index where it occurs. If no new solution is found NULL is returned. This function is meant to be used recursively inside of the solver function in conjunction with upPuz which takes the output of logic1 as input to update the 9x9 puzzle matrix and the 9x9x9 logical array of the sudokuPuzzle object.


JamesCuster/sudokusolvr documentation built on June 4, 2019, 7:46 a.m.