Minesweeper

This project consists of developing a graphical application that simulates the classic Minesweeper game, allowing users to customize the board size, number of mines, and set a time limit for completing the game.

Phase 1: Board Setup and Customization

Create the Minesweeper board with configurable dimensions and mine placement.

  • Allow users to set board size (rows and columns)
  • Allow users to set the number of mines
  • Randomly place mines on the board without overlaps

Functional Output: A Minesweeper board is generated according to user settings, ready for gameplay


Phase 2: Graphical User Interface

Develop the GUI for interacting with the Minesweeper board.

  • Display the board as a grid of clickable cells
  • Provide visual feedback for revealed cells, flagged cells, and mines
  • Include input fields or sliders to set board parameters and start a new game

Functional Output: A functional GUI showing the Minesweeper board and controls for gameplay


Phase 3: Cell Interaction and Game Logic

Implement cell revealing, flagging, and mine detection logic.

  • Left-click reveals a cell and shows the number of adjacent mines
  • Right-click flags a cell as a suspected mine
  • Reveal adjacent empty cells automatically when a cell with 0 neighboring mines is clicked

Functional Output: Clicking and flagging cells works correctly according to Minesweeper rules


Phase 4: Win/Loss Detection

Implement the logic to detect game completion.

  • Detect a win when all non-mine cells are revealed
  • Detect a loss when a mine is clicked
  • Display appropriate messages or animations for win/loss

Functional Output: The game correctly identifies wins and losses with visual feedback


Phase 5: Timer and Time Limit

Add a countdown timer to limit gameplay duration.

  • Allow users to set a time limit in seconds before starting the game
  • Display the remaining time in the GUI
  • End the game automatically when time runs out

Functional Output: The timer counts down correctly and enforces the time limit


Phase 6: Game Reset and Replay

Enable restarting or replaying the game without restarting the application.

  • Provide a “New Game” button that resets the board and timer
  • Retain user-configured settings for convenience
  • Clear previous game data before starting a new game

Functional Output: Users can restart the game with new or existing settings without restarting the application