is_unique: Check if a puzzle has a unique solution

Description Usage Arguments Examples

View source: R/sudoku-checks.R

Description

This function allows you to check whether an unsolved sudoku puzzle has a unique solution.

Usage

1
is_unique(sudoku_matrix, return_all_solutions = FALSE, ...)

Arguments

sudoku_matrix

a sudoku matrix

return_all_solutions

TRUE if you want to return all solutions. FALSE if you want a TRUE/FALSE check on uniqueness. Defaults to FALSE. For puzzles with few clues (fewer than 25), attempting to return all solutions can take a long time.

...

additional arguments to pass to solver.

Examples

1
2
random_puzzle <- generate_puzzle(clues = 30, unique = TRUE, seed = 56)
is_unique(random_puzzle)

alexpavlakis/sudoku documentation built on Feb. 1, 2020, 6:49 p.m.