play_minesweeper {minesweeper} | R Documentation |
Play minesweeper interactively in the current graphics device.
play_minesweeper(
difficulty = c("expert", "intermediate", "beginner"),
nrow = NULL,
ncol = NULL,
mine_count = NULL,
mine_density = NULL,
os_type = c("guess", "unix", "windows")
)
difficulty |
establishes default dimensions and mine count |
nrow , ncol |
dimensions of the minesweeper board |
mine_count |
number of mines to sweep |
mine_density |
proportion of cells that conceal a mine |
os_type |
used to interpret |
Expert difficulty is 16x30 with 99 mines, intermediate 16x16 with 40 mines, and beginner 9x9 with 10 mines.
The current graphics device must support event handling
(see grDevices::getGraphicsEvent()
). If onIdle
is not supported,
the timer will only update on mouse events.
Object of class "minesweeper_recording" to pass to
replay_minesweeper()
or save_minesweeper_gif()
, invisibly.
Left click an empty square to reveal it.
Right click an empty square to flag it.
Middle click a number to reveal its adjacent squares.
Press r to reset the board.
Press q to quit.
x11() # Unix-specific example
recording <- play_minesweeper()
dev.off()