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