Index

ncurses-minesweeper / master

Terminal game of Minesweeper, implemented in C with ncurses.

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
5118 Oct 2021 16:10f5210acUpdate license year infoJosh Stockin133G

Blob @ ncurses-minesweeper / README.md

text/plain2599 bytesdownload raw
1# ncurses Minesweeper
2
3Terminal game of Minesweeper, implemented in C with ncurses.
4
5Minesweeper is a logic game where mines are hidden in a grid of squares. The
6object is to open all the safe squares in the shortest time possible. Use
7the arrow keys to move and <SPACE> to select. Read the Help page for more
8information.
9
10Click 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
15Should be functional on all systems with an ncurses library. PDCurses may be
16dropped in and linked on Windows, although this hasn't been tested. Might work
17on WSL or Cygwin.
18
19Requirements: `build-essential libncurses-dev`
20
21Compiling and linking:
22```
23make 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
28in your shell (given `/usr/local/bin` is in your path).
29
30If you're contributing source code to this repository, install `clang-format
31clang-tidy` and use `make` to target the linter programs. (`clang-format` is
32a bit finicky; make sure you're running version 10.0.0 at least, or it will
33yell at you 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
43All header files correspond to a similarly named source file except
44`src/draw/pages.h`, which encapsulates multiple sources in the same directory,
45and `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
54This package is copyrighted by [Joshua 'joshuas3'
55Stockin](https://joshstock.in/) and licensed under the [MIT License](LICENSE).
56
57A form of the following should be present in each source or header file.
58
59```txt
60ncurses-minesweeper Copyright (c) 2021 Joshua 'joshuas3' Stockin
61<https://joshstock.in>
62<https://git.joshstock.in/ncurses-minesweeper>
63
64This software is licensed and distributed under the terms of the MIT License.
65See the MIT License in the LICENSE file of this project's root folder.
66
67This comment block and its contents, including this disclaimer, MUST be
68preserved in all copies or distributions of this software's source.
69```
70
71&lt;<https://joshstock.in>&gt; | [josh@joshstock.in](mailto:josh@joshstock.in) | joshuas3#9641
72