ruby-stones 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/stones/board.rb +10 -2
- data/lib/stones/version.rb +1 -1
- 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: 54e996a869120addef61727109d79bb1b6870205
|
4
|
+
data.tar.gz: 5378a7237a9434870911d795e816438c1913c0dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc035ebaed291954c6eac9204b7cd0276e52b486cd448b9632fff40d9b6d91dcf32986041cad50a5787126b8d4e3b4da66aa8ec140c4dd92a03638b7a9513d3d
|
7
|
+
data.tar.gz: 8f2e69df31f2fe4084f23c1ae365b0491bda682e3eba53c697060fc33506db70d168b81312bd01e3050e8bb29e9f6da023f9f0ffb638651c63d0ab07bea20314
|
data/lib/stones/board.rb
CHANGED
@@ -22,14 +22,22 @@ module Stones
|
|
22
22
|
|
23
23
|
def ==(other)
|
24
24
|
self.class == other.class &&
|
25
|
-
|
26
|
-
|
25
|
+
cells_equal?(other) &&
|
26
|
+
head_position_equal?(other)
|
27
27
|
end
|
28
28
|
|
29
29
|
def hash
|
30
30
|
self.cells.hash ^ self.head_position.hash
|
31
31
|
end
|
32
32
|
|
33
|
+
def head_position_equal?(other)
|
34
|
+
self.head_position == other.head_position
|
35
|
+
end
|
36
|
+
|
37
|
+
def cells_equal?(other)
|
38
|
+
self.cells == other.cells
|
39
|
+
end
|
40
|
+
|
33
41
|
def self.empty(x, y, position=[0, 0])
|
34
42
|
self.new(empty_cells(x, y), position)
|
35
43
|
end
|
data/lib/stones/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-stones
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Federico Aloi
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-06-
|
12
|
+
date: 2015-06-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|