R/readSudoku.R

Defines functions readSudoku

Documented in readSudoku

readSudoku <- function(fn, map=c(1:9,letters)) {
  z <- scan(fn, "", quiet=TRUE)
  z <- do.call(rbind, strsplit(z, ""))
  matrix(match(z, map, 0), nrow(z))
}

Try the sudoku package in your browser

Any scripts or data that you put into this service are public.

sudoku documentation built on April 19, 2022, 5:09 p.m.