DEV Community

adrianhuuk
adrianhuuk

Posted on

Minesweeper Terminal Game

I have created this game as part of the Python3 CodeCademy course, in which the final task is to create a terminal game. I chose Minesweeper because I wanted to challenge myself and as I didn't even know how to play it at the time, it seemed like the perfect challenge to attempt.

Screenshot of game running in terminal

My implementation of this game includes 3 different difficulties, each with a different number of squares and mines. At the start of each go, the player must choose whether they want to "dig" or "flag" and which square they wish to do this in. If the player chooses dig, the game will then detect whether that square is a mine, and if so, will immediately end the game. If it is not a mine, the game will show that square to the player. When the player flags a square, the game checks if all of the mines have been flagged. When this is the case, the game will end and the player will be told that they have won.

GitHub logo adrianhuuk / Minesweeper

This is a terminal-based re-creation of the classic game Minesweeper.

Minesweeper

This is a terminal-based re-creation of the classic game Minesweeper.

When you begin the game, you will be asked to choose your difficulty. This will affect the number of mines as well as the area that you will be playing in. The difficulties are as follows: 1. 10 mines, 8x8 2. 40 mines, 16x16 3. 99 mines, 16x30 Once you have chosen your difficulty, you will be asked to enter coordinates. This will be the first square revealed. After this, on each go you will be asked whether you or dig or flag before entering coordinates.

PLEASE NOTE THAT COORDINATES ARE 0-INDEXED AND SHOULD BE COUNTED STARTING FROM THE TOP-LEFT.

EG. In the grid below, the x is in the coordinate position (0,4)

. . . . .
. . . . .
. . . . .
. . . . .
x . . . .



Top comments (0)