Description Usage Arguments Details Value See Also Examples
This function creates a new msweepeR board of width w
and height h
,
with the specified number of mines m
.
1 | msBoard(w = 10, h = 10, m = as.integer(5))
|
w |
Width of the game board. Must be a positive integer > 3. |
h |
Height of the game board. Must be a positive integer > 3. |
m |
Number of mines in the board. Must be a positive integer. Please keep in mind that the number of mines can't be higher than half of the total number of tiles. |
This function is called with the constructor msweepeR
, and it's recommended that
it's only called through such class constructor.
This function returns an R object of class msBoard
. It contains a
matrix representing the mines positions in the game board, a matrix representing
the mine count in the 8 neighbouring tiles, and a matrix representing the player's
uncovered tiles and flags. The msBoard
object also includes some basic info
about the game, like the number of turns (moves) playes, whether the player has already
opened a mined tile, the total number of flags, the total number of mines, and the board size.
1 | x <- msBoard()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.