ruby-stones 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/lib/stones/board.rb +6 -6
- data/lib/stones/version.rb +1 -1
- metadata +13 -13
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MWI0MWI1NTAwZmNlNWIxZGFmNzg1N2EyOWVjZmY1MmQxY2NjYzg4Mg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
N2EyNTFjNGQyYjkzNzY2OWE3OTdhYzVkNzhhYWMxNGFlMjIwYjJjMg==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZWI2ZDY4ZDI0ZDM4NGIzNGM0NWY0NDA0Y2Y4YzNkZjZlNWIzODcwM2ZkODFk
|
10
|
+
YmM2OWU3ZTkyZjlhNTRjMjc4NTFhMmIxODNkNzJjZjdiZThjODdiNzY0Mjkx
|
11
|
+
ZmQ1MmI3Njc3MGIxNzVkYTYxZDdmNTE3YjI4Mjg4NWY0Mzg4N2Q=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
NGY1NjlmOTFjMjg5MTI2YzlmNTg1OTgwYWEzODVhYWNlNjg0M2RlMDNlN2Q0
|
14
|
+
MzY0YzY4MTAzNGI2ZGEzODA4OWFjNWVlMjk5NGQ3OTI5OTc5ZTNkNWM0Yjcx
|
15
|
+
Mjk3OGEzMTNkNDNmNzdiMmI2Zjg4MTk3MGUwM2JmYWQ2MThhNzE=
|
data/lib/stones/board.rb
CHANGED
@@ -46,8 +46,6 @@ module Stones
|
|
46
46
|
self.new(cells.map { |row| row.map { |cell| empty_cell.merge(cell) } }, position)
|
47
47
|
end
|
48
48
|
|
49
|
-
private
|
50
|
-
|
51
49
|
def each_cell
|
52
50
|
(0..(size[0]-1)).each do |x|
|
53
51
|
(0..(size[1]-1)).each do |y|
|
@@ -61,6 +59,12 @@ module Stones
|
|
61
59
|
cells[-(position[1]+1)][position[0]]
|
62
60
|
end
|
63
61
|
|
62
|
+
def head_cell
|
63
|
+
cell_at(head_position)
|
64
|
+
end
|
65
|
+
|
66
|
+
private
|
67
|
+
|
64
68
|
def set_cell(position, cell)
|
65
69
|
cell_at(position).merge! cell
|
66
70
|
end
|
@@ -71,10 +75,6 @@ module Stones
|
|
71
75
|
position[0] < x && position[1] < y
|
72
76
|
end
|
73
77
|
|
74
|
-
def head_cell
|
75
|
-
cell_at(head_position)
|
76
|
-
end
|
77
|
-
|
78
78
|
def self.empty_cell
|
79
79
|
{red: 0, black: 0, green: 0, blue: 0}
|
80
80
|
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.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Federico Aloi
|
@@ -9,62 +9,62 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-02-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- -
|
18
|
+
- - ~>
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '1.7'
|
21
21
|
type: :development
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- -
|
25
|
+
- - ~>
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '1.7'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rake
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- -
|
32
|
+
- - ~>
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '10.0'
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - ~>
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '10.0'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rspec
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- -
|
46
|
+
- - ~>
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: '2'
|
49
49
|
type: :development
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- -
|
53
|
+
- - ~>
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '2'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: codeclimate-test-reporter
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- -
|
60
|
+
- - ! '>='
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '0'
|
63
63
|
type: :development
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- -
|
67
|
+
- - ! '>='
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '0'
|
70
70
|
description: Write Gobstones program within Ruby
|
@@ -100,17 +100,17 @@ require_paths:
|
|
100
100
|
- lib
|
101
101
|
required_ruby_version: !ruby/object:Gem::Requirement
|
102
102
|
requirements:
|
103
|
-
- -
|
103
|
+
- - ! '>='
|
104
104
|
- !ruby/object:Gem::Version
|
105
105
|
version: '0'
|
106
106
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ! '>='
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
requirements: []
|
112
112
|
rubyforge_project:
|
113
|
-
rubygems_version: 2.
|
113
|
+
rubygems_version: 2.4.5
|
114
114
|
signing_key:
|
115
115
|
specification_version: 4
|
116
116
|
summary: Pure ruby library that implements a Gobstones-like board and dsl
|