Skip to content

ddevv15/MineSweeper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

MineSweeper ASCII Game

This project implements an ASCII version of the classic MineSweeper game that you can play in your terminal.

Objectives

  • Practice working with functions.
  • Learn about array usage.
  • Implement the logic for a complex program.

Game Overview

  • Board Layout:
    The minefield is predefined with 8 rows and 5 columns, and starts as an empty ASCII grid.

  • Commands:
    Commands are strings of three characters in the format "aij", where:

    • a: Action type
      • f to flag a cell.
      • r to reveal a cell.
      • u to undo a flag.
    • i: Row index (starting from 0).
    • j: Column index (starting from 0).

    Example: f12 flags the cell at row 1, column 2.

  • Game Mechanics:

    • Revealing a cell (r) shows the number of adjacent mines (including diagonals).
    • If a revealed cell is a mine, the game ends with an explosion, marking incorrect flag placements with an "&".
    • The game supports undoing a flag with u.

Submission Guidelines

  • Functions:
    You must complete the functions as described in the starter code without changing their names or the board's representation.

  • Autograder:
    The program must produce exact output for each given input as per the sample outputs. Test each function separately using the provided autograder.

  • Collaboration:
    Work individually. If you collaborate, document the help in the header of your code.

Extra Credit

Implement the recursive reveal feature:

  • When a cell with no adjacent mines is revealed, the game should automatically reveal its surrounding cells.
  • This feature requires recursion and continues until cells with non-zero adjacent mines are reached.
  • Refer to the starter code for further instructions.

Happy coding!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages