Project Report
Project Report
BY
PRERANA ANAND 1CR21IS120
CAREN ELRIN DSA 1CR21IS188
ZAYED ALI
1CR21IS187
Date
2
INTRODUCTION
● Understand the rules of Minesweeper: Before starting the project, it's essential to understand the rules of
Minesweeper. The game involves uncovering cells on a grid, where some cells contain mines. The
objective is to uncover all cells that don't contain mines without detonating any of the mines. The number
on each cell represents the number of adjacent cells that contain mines, and using this information, the
player can deduce the location of the mines.
● Design the game board: The game board is a grid of cells, where each cell can be in one of three states:
covered, uncovered, or flagged. You can represent the board as a two-dimensional array or as a grid of
objects, depending on your preference.
● Implement the game logic: The game logic involves handling user input, updating the game board, and
checking for win/lose conditions. You'll need to handle user input for uncovering cells, flagging cells, and
starting a new game. When a cell is uncovered, you'll need to update the game board and check for
adjacent cells that contain mines. If a mine is uncovered, the game is over, and the player loses. If all non-
mine cells are uncovered, the player wins.
5
METHODOLOGY
● Add user interface: The game should have a user interface that displays the game board, tracks the player's
score, and provides feedback to the user. You can use a graphical user interface (GUI) library to create the
user interface, or you can implement a text-based interface using the console or terminal.(If time permits)
● Test the game: Once you've implemented the game, you should test it thoroughly to ensure that it works as
expected. Test all possible scenarios, including uncovering cells, flagging cells, and winning/losing the
game. You can use automated tests or manual tests to test the game.(If time permits)
6
CONCLUSION
In conclusion, the Minesweeper project requires the use of several data structures such as game board, mines set, adjacency matrix, and
stack or queue. These data structures play a vital role in implementing the game logic and user interface and help make the game more
efficient and playable.
1. Game board: The game board is a two-dimensional array or grid of objects that represents the playing field. Each cell in the grid can
be in one of three states: covered, uncovered, or flagged. You can use a two-dimensional array or a grid data structure to represent
the board.
2. Mines: The mines in the game are randomly placed on the game board. To keep track of the location of the mines, you can use a set
or a list data structure. A set is useful for checking if a cell contains a mine, while a list is useful for randomly placing the mines on
the board.
3. Adjacency matrix: To determine the number of adjacent mines to a cell, you can use an adjacency matrix. The adjacency matrix is a
two-dimensional array that indicates which cells are adjacent to each other. You can use this matrix to count the number of adjacent
mines for each cell.
4. Stack or Queue: When a cell is uncovered, it may reveal additional cells that need to be uncovered. To keep track of the cells that
need to be uncovered, you can use a stack or a queue data structure. A stack is useful for a depth-first search algorithm, while a
queue is useful for a breadth-first search algorithm.
INFORMATION SCIENCE