designGame: Sudoku Design

Description Usage Arguments Value Examples

View source: R/sudokuAlt.R

Description

Take a sudoku game and represent the information as a data frame giving the row, column, square and symbol for each entry. This is a useful form if the (complete) game is to be used as an experimental design

Usage

1
2
3
4
5
6
7
designGame(g, ...)

## Default S3 method:
designGame(g, ...)

## S3 method for class 'sudoku'
designGame(g, ...)

Arguments

g

a sudoku game, presumably solved

...

currently ignored

Value

a data frame with four colums, Row, Col, Square and Symbol

Examples

1
2
3
4
5
set.seed(2019)
d <- seedGame(4) %>% solve() %>%
     regulariseGame(target = "b") %>%
     designGame()
rbind(head(d), tail(d))

Example output

    Row Col Square Symbol
001 R01 C01    S11      A
002 R01 C02    S11      B
003 R01 C03    S11      C
004 R01 C04    S11      D
005 R02 C01    S11      E
006 R02 C02    S11      F
251 R15 C15    S44      N
252 R15 C16    S44      D
253 R16 C13    S44      P
254 R16 C14    S44      G
255 R16 C15    S44      M
256 R16 C16    S44      K

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