Code Monkey home page Code Monkey logo

tmines's Introduction

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.

tmines's People

Contributors

tropf avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

tmines's Issues

display error

invoke tmines using tmines -x 30 -y 16 -c99 -s 1540264520

Message is irrelevant, actual problem: display errors, misalignment of 3rd row after execution of below commands

crash report:

Error Report

Message:
  60x19 terminal required to display this 30x16 minefield (Current: 170x10)

Keypresses for error: > k k k ll ljjlfhjfk l j l k lkh lkfh lj l k j lkfh k h hkfj h hk l h j hkfj h lklk j hk jjhj hkfj j hjfk j h j jh l jhfk h jhfl j l lllk ljfk l j h j h k jhfk h h jhfk hjf kk kkkkkllll hkfj h kfj h khfl k lljl ll hkfjh llklllll ljjjjjjh jhfk hjfh j l hj jlfh j lkkkkll jhfh lj h ljf hj hhhk hjfk k jhfl jh kkh h khkhkkkkkkkllllll k h jjh kllllllllljj j j j j j j h h hj jhj h h hhh kkhjfhfk h h kkkk kjjjj j lllllllllkkllj jlhll  hhh llhjkjkjj h  h h h llkkkkkkkkkkkkllljhklhll hj hhk hklhhhlflfhj h h hkfj h k jjk hjfk jh kfhfj h k lk hjlh h  l jhfkjfkjkklljjhhjh --<

Settings:
  Width, Height:     30, 16
  Mine Count:        99
  Seed:              1540264520
  Autodiscover only: disabled
  Fullscreen:        disabled
  Args:              -x 30 -y 16 -c99

Terminal:
  Lines: 10
  Cols:  170

Version
  Version Number: 1.0
  Git Commit:     c1e544f6ba5871f0a3d831ca25512ae5ba8f9f58

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.