A minesweeper clone in ruby. Play a minesweeper-like game in your terminal!
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
lib
test
.gitignore
README.textile
Rakefile

README.textile

bloodymines

A minesweeper clone done in ruby.

Play minesweeper in your terminal!

Installation

gem install bloodymines

Play

open your terminal
enter “bloodymines”
enjoy
For more help:
bloodymines -h

Keybindings

Use the arrow keys to move your cursor around.
Hit [space] to reveal a field.
Q, q or [esc] will quit the game.

Using the bloodymines gem within your own interface/program

require “bloodymines”
game = Bloodymines.new(:difficulty => :expert) # valid difficulties are :beginner, :intermediate and :expert

The Bloodymines class provides following methods:

uncover(x, y) => uncovers the field at x, y
difficulty => difficulty of the game (:beginner, :intermediate, :expert)
width => width of the minefield
height => height of the minefield
result => returns a hash {:score => Integer, :finished => Boolean}
ended? => returns true if the game is over, else false
minefield.fields => a 2d Array. minefield.fields[x][y] to get a field.