/tmines

terminal minesweeper clone

Primary LanguageC++MIT LicenseMIT

tmines

Build Status
tmines is a minesweeper clone playable from the terminal.

The idea came to mind when I waited for a java project to compile -- for the entirety of two minutes.
I started playing the fabolous netris during such times, but it's not made to be played like this. It's not turn based and a hassle to pause and resume. With minesweeper you can just drop the game as soon as you project finishes compiling and pick up the same game half an hour later.

As I had enough time and motivation, this idea slowly came into existance. I found myself doing 'just one more run' way too often during playtesting.

So if you want to waste some time of your life on a fun game, go ahead and follow the installation instructions.

Usage

tmines ships with a manpage, use that if this short cheatsheet is not sufficient.

Controls

Action Keys
Quit Q
Movement WASD, HJKL, Arrow keys
Open spots Spacebar
Place a Flag F

Options

Not all options are mentioned here, please consult the manpage and tmines --help.

Option Effect
--height set the height of the board
--width set the width of the board
--mine-count set the amount of mines to be placed
--seed give an initial value for the randomizer

Examples

just jump right into it:

tmines

play on fullscreen:

tmines -f

the original expert mode:

tmines -x 30 -y 16 -c 99

Installation

Binary Builds

Ubuntu

For Ubuntu users a PPA is available.

sudo add-apt-repository ppa:tropf/ppa
sudo apt-get update
sudo apt-get install tmines

If there is no build for your version of ubuntu, please open a Github issue. Thank You!

Archlinux

Archlinux users can use the AUR.

git clone https://aur.archlinux.org/tmines.git && cd tmines
makepkg
makepkg -i

Voidlinux

The package is available in the official voidlinux repository. (Thanks SolitudeSF!)

xbps-install -S tmines

Building From Source

Dependencies

Running

tmines requires the curses library to display information to the console.

Building

The Project uses the c++11 standard, so you need a suitable compiler for that. Any recent version of g++ will work.

Cmake is used as a build system. For building the documentation, doxygen is required.

Dependency Oneliners For Building

Also install a compiler for C++. Any recent g++ will work.

Archlinux
sudo pacman -S ncurses cmake doxygen
Debian and Ubuntu
sudo apt-get install libncurses5-dev libncurses5 cmake doxygen

Build Process

First install the dependencies, then build the project using the following commands.

git clone https://github.com/tropf/tmines
cd tmines
mkdir build && cd build
cmake ..
make
sudo make install

Uninstall

If you installed using your package manager, use it to remove the package.

sudo apt-get remove tmines # Ubuntu, Debian
sudo pacman -R tmines # Archlinux

If you installed from source, you can:

  • Use the official way
    1. Go into the directory where you built and installed.
    2. Delete all files that are listed in the install-manifest.txt file.
      This file has been generated by cmake when installing
      You can use xargs rm < install_manifest.txt as a shortcut.
  • Use the hacky way
    1. find the executable using which cmake
    2. find the path of the manpage man --path tmines
    3. simply delete both these files

License

This project is available under the MIT license.

Github

Find this project on Github.