R/update_neighbors.R

Defines functions update_neighbors

update_neighbors <- function(board, cell, nbors, m, nrow, ncol, to_hide = FALSE) {
  mat <- matrix(FALSE, nrow, ncol)
  mat[nbors][m] <- TRUE
  update_cells(board, cell, mat, to_hide = to_hide)
}

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.