sudoku (version 2.6)

generateSudoku: Randomly Generate a Sudoku Puzzle Grid

Description

Creates a 9x9 Sudoku grid suitable for use by playSudoku.

Usage

generateSudoku(Nblank=50, print.it=FALSE)

Arguments

Nblank

Number of cells to blank out

print.it

Logical. If true, print result to screen.

Value

A matrix, representing a 9x9 Sudoku grid.

Details

The basic algorithm is to start with a 'primordial' Sudoku grid, swap around some rows and columns, then blank out some cells.

References

http://sudoku.com/

Examples

Run this code
# NOT RUN {
generateSudoku(print.it=TRUE)
# }

Run the code above in your browser using DataLab