R/flag_cell.R

Defines functions flag_cell

flag_cell <- function(board, i, j) {
  cell <- switch(
    board[[i, j]],
    `F` = "-",
    `-` = "F"
  )
  if(is.null(cell)) return(board)
  update_cell(board, cell, i, j)
}

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.