Giter Site home page Giter Site logo

piotrmurach / minehunter Goto Github PK

View Code? Open in Web Editor NEW
22.0 3.0 0.0 118 KB

Terminal mine hunting game.

License: GNU Affero General Public License v3.0

Ruby 99.90% Shell 0.10%
ruby rubygem terminal-game game minesweeper puzzle-game minesweeper-game cross-platform

minehunter's Introduction

Minehunter

Gem Version Actions CI Build status Maintainability Coverage Status

Terminal mine hunting game built with TTY toolkit components.

Minehunter is a terminal puzzle game inspired by the classic "Minesweeper".

To win a game, a player needs to uncover all the fields inside the grid that don't contain mines. Uncovering a field with a mine immediately ends the game. When an uncovered field has no mine present, it can either be empty or show a number. The number specifies how many mines are in surrounding fields. Armed with this knowledge, the player can deduce fields safe to uncover and use a flag to mark the ones that hide a mine. The number of available flags matches the number of the randomly placed mines. But, the player is not required to use any flags to win the game.

There are three preconfigured difficulty levels:

  • Easy - 9x9 with 10 mines
  • Medium - 16x16 with 40 mines
  • Hard - 32x32 with 99 mines

The player can also create a custom grid with an arbitrary number of mines.

Here is an example of playing on a 20x10 grid with 30 mines:

Playing Minehunter

Installation

Add this line to your application's Gemfile:

gem "minehunter"

And then execute:

$ bundle install

Or install it yourself as:

$ gem install minehunter

Usage

To start the game, run:

$ minehunter

Alternatively, run an alias:

$ minehunt

To change difficulty level use --level or -l option with easy, medium or hard:

$ minehunter --level easy

To customise the number of grid columns use --cols or -c option. Likewise, specify --rows or -r option to set the number of grid rows. For example, to play a game on a grid with 20 columns and 15 rows do:

$ minehunter --cols 20 --rows 15

Use --mines or -m option to set number of mines to be randomly placed on a grid:

$ minehunter --mines 25

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/piotrmurach/minehunter. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The gem is available as open source under the terms of the GNU Affero General Public License v3.0.

Code of Conduct

Everyone interacting in the Minehunter project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

Copyright

Copyright (c) 2021 Piotr Murach. See LICENSE.txt for further details.

minehunter's People

Contributors

piotrmurach avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.