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 | the arrow keys 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 | [![Minesweeper demo](http://img.youtube.com/vi/g7InqPoMShA/maxresdefault.jpg)](http://www.youtube.com/watch?v=g7InqPoMShA "Minesweeper demo") |
12 |
|
13 | ## Compiling and Linking |
14 |
|
15 | Should be functional on all systems with an ncurses library and `sys/time.h` |
16 | header. PDCurses may be dropped in and linked on Windows, although this hasn't |
17 | been tested. Might work on WSL or Cygwin. |
18 |
|
19 | Requirements: `build-essential libncurses-dev` |
20 |
|
21 | Compiling and linking: |
22 | ``` |
23 | make compile build |
24 | ``` |
25 |
|
26 | **Binary executable deposited at `bin/minesweeper`.** You can copy this to |
27 | `/usr/local/bin/minesweeper` to run the game as `minesweeper` from any location |
28 | in your shell (given `/usr/local/bin` is in your path). |
29 |
|
30 | If you're contributing source code to this repository, install `clang-format |
31 | clang-tidy` and use `make` to target the linter programs. (`clang-format` is |
32 | a bit finicky; make sure you're running version 10.0.0, or it will yell at you |
33 | about unsupported configuration in `.clang-format`.) |
34 |
|
35 | ## Program structure |
36 |
|
37 | * Entry point at `src/main.c` |
38 | * State structs at `src/state.h` |
39 | * Rendering logic loop at `src/draw/draw.c` |
40 | * Game logic handler (input) at `src/game/game.c` |
41 | * Game renderer at `src/draw/game.c` |
42 |
|
43 | All header files correspond to a similarly named source file except |
44 | `src/draw/pages.h`, which encapsulates multiple sources in the same directory, |
45 | and `src/state.h`, which provides struct definitions for game state data. |
46 |
|
47 | ## TODO |
48 |
|
49 | * Rewrite Options screen controls |
50 | * Rewrite game board renderer |
51 |
|
52 | ## Copyright and Licensing |
53 |
|
54 | This package is copyrighted by [Joshua 'joshuas3' |
55 | Stockin](https://joshstock.in/) and licensed under the [MIT License](LICENSE). |
56 |
|
57 | A form of the following should be present in each source or header file. |
58 |
|
59 | ```txt |
60 | ncurses-minesweeper Copyright (c) 2020 Joshua 'joshuas3' Stockin |
61 | <https://joshstock.in> |
62 | <https://github.com/JoshuaS3/ncurses-minesweeper> |
63 | This software is licensed under the MIT License. |
64 | ``` |
65 |
|
66 | <<https://joshstock.in>> | josh@joshstock.in | joshuas3#9641 |
67 |
|