In my first semester of University, I developed a minesweeper program for my MATLAB & C course. It is console-based and prints instructions for the user to follow. It contains an intuitive design with lots of input validation to ensure the game runs smoothly.

The program generates a random minesweeper grid based off customisable input parameters. It can also load a save file. Each move, you have the option to reveal, flag, or unflag a tile, or to save and exit the game. The goal is to reveal all tiles which aren’t mines. When you reveal a tile, it displays the number of adjacent mines.

If there are no adjacent mines, a recursive depth-first search function will automatically reveal all adjacent zeros, and their surrounding tiles.

At the end of the game, an image is automatically generated displaying the board so you can share the game you just played.
