R/new_mines.R

Defines functions new_mines

new_mines <- function(nrow, ncol, mine_count) {
  mines <- matrix(FALSE, nrow, ncol)
  mines[sample.int(nrow*ncol, mine_count)] <- TRUE
  mines
}

Try the minesweeper package in your browser

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

minesweeper documentation built on April 3, 2025, 9:29 p.m.