play_minesweeper {minesweeper}R Documentation

Start a Minesweeper Game

Description

Play minesweeper interactively in the current graphics device.

Usage

play_minesweeper(
  difficulty = c("expert", "intermediate", "beginner"),
  nrow = NULL,
  ncol = NULL,
  mine_count = NULL,
  mine_density = NULL
)

Arguments

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

Details

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.

Value

Object of class "minesweeper_recording" to pass to replay_minesweeper() or save_minesweeper_gif(), invisibly.

Examples


dev.new(noRStudioGD = TRUE)
recording <- play_minesweeper()
dev.off()


[Package minesweeper version 1.0.0 Index]