fun (version 0.2)

mine_sweeper: Play the Mine Sweeper game in R

Description

The controls should be familiar to you: Click the left mouse button to dig in an area, and right button to mark or unmark the area with flags.

Usage

mine_sweeper(width = 10, height = 10, mines = 20, cheat = FALSE)

Arguments

width

number of grids in horizontal axis

height

number of grids in vertical axis

mines

number of mines

cheat

logical. If TRUE a matrix indicating the mines will be printed

References

http://en.wikipedia.org/wiki/Minesweeper_(computer_game)

Examples

Run this code
# NOT RUN {
## should use Xlib for the x11() device under *nix, e.g
if (interactive()) {
    if (.Platform$OS.type == "windows") 
        x11() else x11(type = "Xlib")
    mine_sweeper()
}
# }

Run the code above in your browser using DataCamp Workspace