regulariseGame: regulariseGame

Description Usage Arguments Details Value Examples

View source: R/sudokuAlt.R

Description

Put a solved sudoku game into a canonical form

Usage

1
2
3
4
5
6
7
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

1
2
3
4
5
6
set.seed(1234)
g <- makeGame() %>%
     solve() %>%    
     regulariseGame(target = "b") %>% 
     plot()
plot(originalGame(g))

sudokuAlt documentation built on Dec. 16, 2019, 1:23 a.m.