R/cell2grob.R

Defines functions cell2grob

cell2grob <- function(cell) {
  switch(
    as.character(cell),
    `-` = hidden,
    ` ` = blank,
    `F` = flag,
    `m` = mine,
    `M` = explosion,
    `X` = not_mine,
    number[[as.integer(cell)]]
  )
}

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.