regulariseGame {sudokuAlt} | R Documentation |
regulariseGame
Description
Put a solved sudoku game into a canonical form
Usage
regulariseGame(g, ...)
## S3 method for class 'sudoku'
regulariseGame(g, target = c("block", "col", "row"), ...)
## Default S3 method:
regulariseGame(g, ...)
Arguments
g |
a solved sudoku game |
... |
additional arguments to methods (currently not used) |
target |
character; which section do you want to be in sorted order? |
Details
If a solved sudoku game is to be used as an experimental design it is sometimes useful to re-arrange the symbols so that either the first row, first column or top left block symbols are in sorted order. This function accomplishes this task.
Value
a regularised solved sudoku game
Examples
set.seed(1234)
g <- makeGame() %>%
solve() %>%
regulariseGame(target = "b") %>%
plot()
plot(originalGame(g))
[Package sudokuAlt version 0.2-1 Index]