Professional Documents
Culture Documents
using the arrangement of mines as a loss for the player; otherwise the
certificate. If, however, a minesweeper
number of mines immediately adjacent
board is already guaranteed to be to it is revealed to the player in form of
consistent, solving it is not known to be
a number (0–8). This number will
NP-complete, but it has been proven to
be co-NP-complete.
remain the label of the probed square
Kaye also proved that infinite for the remainder of the game. If the
minesweeper is Turing complete. player uncovers the last square not
containing a mine the game finishes
This project contains two modules, with a win for the player.
the game and the solver. The game
implementation presents a command N-consistency
line interface for the user to interact Given an n-dimensional grid partially
with the puzzle and solve it. The solver marked with numbers and/or mines,
serves as a hint for the player solving
some squares being blank, determine if
the puzzle when needed. The solver
essentially analyzes the same grid
there is some pattern of mines in the
shown to the user and makes an blank squares that give rise to the
optimum move which reveals a covered numbers seen.
tile. It is intuitive that by adding extra
dimensions to the playing area the game
becomes harder, so it would be
I. THE MINESWEEPER PROBLEM expected that 3-consistency is NP-hard.
T he Minesweeper is a one-person
board game played on a rectangular
In fact, n-consistency is NP-complete
for any n≥2. An interesting situation
grid of size k by l. Let such a game be arises however when reducing the
of size n where n = kl. Also choose m, dimension to one, since it is not
such that m < n, to be the number of immediately clear how to construct
hidden mines on the grid. Initially all logic gates as in the 2-dimensional
the squares on the grid are empty, and it variation.
is the aim of the game to uncover all the
squares that do not contain a mine and n-dimensional Minesweeper is NP-
mark (or leave blank) all the squares complete
containing a mine. At each move the n-consistency can be inductively
player must either choose an unlabeled reduced to (n+1) consistency. At a high
square to ‘probe’ or mark a square as level, the reduction is to construct a
containing a mine. If the probed square wire, an and gate and a not gate by
contains a mine the game is over with a
18BCB0038 3
REFERENCES
AUTHOR
Siddharth Garg (18BCB0038)
is a student at Vellore Institute
of Technology, currently
pursuing 1st year of Bachelors
of Technology. This project is
created by him as part of his
course ‘Data Structures &
Algorithms’ under the guidance of Dr. (Prof.)
Boominathan