A modern console-based implementation of the classic Minesweeper game, written in C++, featuring multiple difficulty levels, user accounts, performance tracking, and a leaderboard system.
Disclaimer: This project is a personal educational project inspired by the classic Minesweeper game. It is not affiliated with or endorsed by Microsoft or any other entity.
This project recreates the classic Minesweeper experience right in your terminal — complete with colorful visuals, Unicode characters, and smooth gameplay.
It includes features such as account management, difficulty modes, leaderboards, and data persistence for tracking your performance.
- 🧠 Classic Gameplay — Reveal safe cells and avoid the mines!
- 🎚️ Difficulty Levels — Easy, Medium, Hard, or Custom grids
- 👤 User Accounts — Create and manage player profiles
- 🏆 Leaderboard System — Compare your best times and scores
- 🎨 Visual Console UI — Color-coded text and Unicode graphics
- 🔒 First Move Safety — Your first step is always safe
- Windows OS (uses Windows Console API)
- C++11 compatible compiler (e.g., MinGW, Visual Studio)
- Console supporting UTF-8 characters
- Create an account or log in.
- Select a difficulty level.
- Use the following controls:
WASD→ Move cursorEnter→ Reveal a cellF→ Flag or unflag a cellEsc→ Exit the game
Goal: Clear all safe cells without detonating a mine!
- Each revealed number shows how many mines surround that cell.
- Use logic to flag or clear cells safely.
- If you open a mine — game over! 💣
- Win by uncovering all non-mine cells.
Game data and user information are saved in text files:
USERS DATA FOLDER/
│
├── UDF.txt → User credentials
├── easyPlayers.txt → Easy mode stats
├── mediumPlayers.txt → Medium mode stats
└── hardPlayers.txt → Hard mode stats
Minesweeper/
│
├── maingame.cpp
├── GUIDE/
│ ├── MineSweeperGuidePage1.txt
│ ├── MineSweeperGuidePage2.txt
│ └── MineSweeperGuidePage3.txt
├── LOGOS/
│ ├── flag.txt
│ └── gojo.txt
├── USERS DATA FOLDER/
│ ├── UDF.txt
│ ├── easyPlayers.txt
│ ├── mediumPlayers.txt
│ └── hardPlayers.txt
└── CLEAR DATA/
└── clearDataSection.txt
g++ maingame.cpp -o maingame.exe -std=c++11cl /EHsc maingame.cpp /Fe:maingame.exe| Level | Grid Size | Mines |
|---|---|---|
| Easy | 9×9 | 10 |
| Medium | 14×14 | 40 |
| Hard | 20×20 | 99 |
| Custom | NxN (9–40) | 10–N²−1 |
- Game automatically creates data files on first run.
- Admin can clear data using
[5] CLEAR DATAfrom the menu. - Admin password:
AryanGh#Minesweeper
- Ensure directories exist (
GUIDE,LOGOS,USERS DATA FOLDER, etc.) - Use UTF-8 enabled console for proper visuals
- Verify compiler supports C++11
Developed by Aryan Ghasemi
This project is licensed under the MIT License — see LICENSE for details.
