| 1 | # ncurses Minesweeper |
| 2 |
|
| 3 | Terminal game of Minesweeper, implemented in C with ncurses. |
| 4 |
|
| 5 | Minesweeper is a logic game where mines are hidden in a grid of squares. The |
| 6 | object is to open all the safe squares in the shortest time possible. Use |
| 7 | \<hjkl\> to move and \<SPACE\> to select. Read the Help page for more |
| 8 | information. |
| 9 |
|
| 10 | Click to watch a video demo on YouTube: |
| 11 | [](http://www.youtube.com/watch?v=g7InqPoMShA "Minesweeper demo") |
| 12 |
|
| 13 | ## Building |
| 14 |
|
| 15 | Currently functional on all systems with an ncurses library. PDCurses may be |
| 16 | dropped in and linked on Windows, although this hasn't been tested. |
| 17 |
|
| 18 | Requirements: `build-essential libncurses-dev` |
| 19 |
|
| 20 | Compiling and linking: |
| 21 | ``` |
| 22 | make compile build |
| 23 | ``` |
| 24 |
|
| 25 | **Binary executable deposited at `bin/minesweeper`.** |
| 26 |
|
| 27 | **If you're contributing source code to this repository, install `clang-format |
| 28 | clang-tidy` and use `make` to target the linter programs.** (`clang-format` is |
| 29 | a bit finicky; make sure you're running version 10.0.0, or it will yell at you |
| 30 | about unsupported configuration in `.clang-format`.) |
| 31 |
|
| 32 | ## Program structure |
| 33 |
|
| 34 | * Entry point at `src/main.c` |
| 35 | * Rendering logic loop at `src/draw/draw.c` |
| 36 | * Game logic handler at `src/game/game.c` |
| 37 | * Game renderer at `src/draw/game.c` |
| 38 |
|
| 39 | All header files correspond to a similarly named source file except |
| 40 | `src/draw/pages.h` which encapsulates multiple sources in the same directory. |
| 41 |
|
| 42 | ## TODO |
| 43 |
|
| 44 | * Rewrite Help screen message |
| 45 | * Rewrite Options screen controls |
| 46 | * Use millisecond/microsecond precision for stopwatch |
| 47 | * Rewrite game management logic (memory handling, mine count setting) |
| 48 |
|
| 49 | ## Copyright and Licensing |
| 50 |
|
| 51 | This package is copyrighted by [Joshua 'joshuas3' |
| 52 | Stockin](https://joshstock.in/) and licensed under the [MIT License](LICENSE). |
| 53 |
|
| 54 | A form of the following should be present in each source or header file. |
| 55 |
|
| 56 | ```txt |
| 57 | ncurses-minesweeper Copyright (c) 2020 Joshua 'joshuas3' Stockin |
| 58 | <https://joshstock.in> |
| 59 | <https://github.com/JoshuaS3/ncurses-minesweeper> |
| 60 | This software is licensed under the MIT License. |
| 61 | ``` |
| 62 |
|
| 63 | <<https://joshstock.in>> | joshstockin@gmail.com | joshuas3#9641 | |
| 64 | [LinkedIn](https://www.linkedin.com/in/joshstockin/) |
| 65 |
|