minesweeper-curses 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/bin/minesweeper-curses +1 -1
- data/lib/minesweeper/board.rb +7 -5
- data/lib/minesweeper/version.rb +1 -1
- data/readme.md +6 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46549184e142f079bb77874cbe35b4b82ee80f82
|
4
|
+
data.tar.gz: fc5dd237f3a052473c6f85395632c8f7624616c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb826dd21e2512fb6b03c1eddfde73eba42773686f2811dd82c1e7a450b4ca21fffcb6af5565470321f99e315047528b66468a36ea714dfae1e9cce265ee31c9
|
7
|
+
data.tar.gz: 8c8dd51a2a0b80c7d71db83e1e0b8901d55fde6555c965f4d67ba7a0254d7ee12a70e413552156fdaea8ec7ee6ebb88d480394e1dab2a3dc55c07066db4f7164
|
data/Gemfile.lock
CHANGED
data/bin/minesweeper-curses
CHANGED
data/lib/minesweeper/board.rb
CHANGED
@@ -66,13 +66,15 @@ module Minesweeper
|
|
66
66
|
window.setpos(0, 1)
|
67
67
|
end
|
68
68
|
|
69
|
+
def cell_x
|
70
|
+
curx / STEP
|
71
|
+
end
|
72
|
+
|
69
73
|
def open_cell
|
70
|
-
cell_x = curx / STEP
|
71
74
|
open_original(cury, cell_x)
|
72
75
|
end
|
73
76
|
|
74
77
|
def toggle_bomb_flag
|
75
|
-
cell_x = curx / STEP
|
76
78
|
cell = cells[cury][cell_x]
|
77
79
|
cell.toggle_bomb_flag!
|
78
80
|
raise GameWon if game_won?
|
@@ -132,9 +134,9 @@ module Minesweeper
|
|
132
134
|
found_bombs_count = found_bombs.count
|
133
135
|
reveal_bombs
|
134
136
|
draw_board
|
135
|
-
window.setpos(height +
|
137
|
+
window.setpos(height + 1, 0)
|
136
138
|
window.addstr e.message
|
137
|
-
window.setpos(height +
|
139
|
+
window.setpos(height + 3, 0)
|
138
140
|
window.addstr <<~STR
|
139
141
|
Game Stats: you have found #{found_bombs_count} out of #{bombs.count} bombs
|
140
142
|
|
@@ -215,7 +217,7 @@ module Minesweeper
|
|
215
217
|
end
|
216
218
|
|
217
219
|
def number_of_cells
|
218
|
-
|
220
|
+
cells.flatten.count
|
219
221
|
end
|
220
222
|
end
|
221
223
|
end
|
data/lib/minesweeper/version.rb
CHANGED
data/readme.md
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
[](https://travis-ci.org/ruba-ruba/minesweeper)
|
2
2
|
[](https://coveralls.io/github/ruba-ruba/minesweeper?branch=master)
|
3
|
+
[](https://badge.fury.io/rb/minesweeper-curses)
|
3
4
|
|
4
5
|
### Minesweeper Terminal
|
5
6
|
> Console version of [minesweeper game](https://en.wikipedia.org/wiki/Microsoft_Minesweeper) written in [ruby](https://www.ruby-lang.org/en/) & [curses gem](https://github.com/ruby/curses)
|
6
7
|
|
7
8
|
#### Requirements
|
8
9
|
|
9
|
-
- ruby 2.4.1
|
10
|
+
- ruby 2.4.1 or higher
|
10
11
|
|
11
12
|
#### Setup
|
12
13
|
|
@@ -20,13 +21,13 @@
|
|
20
21
|
|
21
22
|
#### Launching
|
22
23
|
|
23
|
-
- minesweeper-curses
|
24
|
+
- `minesweeper-curses`
|
24
25
|
|
25
26
|
#### Controls
|
26
27
|
|
27
|
-
-
|
28
|
-
-
|
29
|
-
-
|
28
|
+
- ←↑→↓ to move over the mineboard
|
29
|
+
- ␣ to mark cell as a bomb
|
30
|
+
- ↵ to open the cell
|
30
31
|
|
31
32
|
#### License
|
32
33
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minesweeper-curses
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mykhailo Rybak
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|