Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hayd1n/cs1010301-minesweeper-project
111.2 CS1010301 物件導向程式設計實習 踩地雷遊戲
https://github.com/hayd1n/cs1010301-minesweeper-project
ntust
Last synced: 1 day ago
JSON representation
111.2 CS1010301 物件導向程式設計實習 踩地雷遊戲
- Host: GitHub
- URL: https://github.com/hayd1n/cs1010301-minesweeper-project
- Owner: hayd1n
- Created: 2023-04-15T18:15:25.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-04-26T07:17:30.000Z (over 1 year ago)
- Last Synced: 2024-08-15T09:54:15.234Z (3 months ago)
- Topics: ntust
- Language: C++
- Homepage:
- Size: 65.9 MB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CS1010301-MineSweeper-Project
111.2 CS1010301 物件導向程式設計實習 踩地雷遊戲.
MineSweeper game with GUI supported, writing in C++.
## Support Platforms
- Windows MSVC
- MacOS AppleClang
- Linux GCC/Clang
> ⚠️ Apple Silicon (arm64) is not currently supported.## Build
```bash
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
```## Run Mode
The game support in console mode and GUI mode.
We can use launch arguments to run the game in different mode.
By default run the game it running in GUI mode.
### Command Input
```bash
./MineSweeper CommandInput
```
### Command File
```bash
./MineSweeper CommandFile
```
### GUI
```bash
./MineSweeper GUI
```## Game State
- Standby
- Playing
- GameOver## Command
| Command | Usage | Standby | Playing | GameOver |
| ------------ | ---------------------------------- | ------- | ------- | -------- |
| `Load` | Load game board | ✅ | | |
| `StartGame` | Start game | ✅ | | |
| `Print` | Print the information | ✅ | ✅ | ✅ |
| `LeftClick` | Left click a block (Uncover block) | | ✅ | |
| `RightClick` | Right click a block (Put flag) | | ✅ | |
| `Replay` | Start a new game | | | ✅ |
| `Quit` | Quit game | | | ✅ |### Load
```
Load
```#### Load Mode
##### BoardFile
Load the generated board file
```
Load BoardFile
```###### Example
```
Load BoardFile ./boards/board1.txt
```##### RandomCount
Generate a board with random count mines
```
Load RandomCount
```###### Example
```
Load RandomCount 10 10 10
```##### RandomRate
Generate a board with random rate mines
```
Load RandomRate
```###### Example
```
Load RandomRate 10 10 0.3
```
```
```#### Print Mode
##### GameBoard
Current game board
- Covered block `#`
- Uncovered block `number`
- Flag `f`
- Question Mark `?`
- Mine `X`###### Example Input
```
Print GameBoard
```###### Example Output
```
0 0 0 0 0 0 0 0 1 #
0 0 0 0 0 0 0 0 1 1
1 1 1 0 0 0 0 0 0 0
# f 1 0 1 1 2 1 1 0
1 1 1 0 1 # ? # 2 1
0 0 0 0 1 1 # # # #
0 0 0 0 0 1 # # # #
0 0 0 0 1 2 # # # #
1 2 1 1 1 # # # # #
# # # # # # # # # #
```##### GameAnswer
###### Example Input
```
Print GameAnswer
```###### Example Output
```
0 0 0 0 0 0 0 0 1 X
0 0 0 0 0 0 0 0 1 1
1 1 1 0 0 0 0 0 0 0
1 X 1 0 1 1 2 1 1 0
1 1 1 0 1 X 2 X 2 1
0 0 0 0 1 1 2 1 2 X
0 0 0 0 0 1 1 1 1 1
0 0 0 0 1 2 X 1 0 0
1 2 1 1 1 X 3 2 0 0
X 2 X 1 1 2 X 1 0 0
```##### GameState
Current game state (Standby/Playing/GameOver).##### BombCount
Current bomb(mines) count in the board.##### FlagCount
Current flags count in the board.##### OpenBlankCount
Current uncovered block count in the board.##### RemainBlankCount
Current covered block count in the board.## Screenshoot
### Console### GUI
## Demo Video
[Watch on YouTube](https://youtu.be/PEyo_t_J6iI)