namero 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/namero/board.rb +1 -1
- data/lib/namero/solver.rb +4 -4
- data/lib/namero/solver_extensions.rb +1 -1
- data/lib/namero/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d873a422ed56c6cd9838805394b1c2fb1ae7ad33f6eb65fb2338880f598fb427
|
4
|
+
data.tar.gz: b71ec4d6319f4267142997c99a3f4ac85d987ef9e5526d837b31544c93eee75d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71ee42cdf9509fd8daf2699a37f9979ee83ae4f70dbeaaed762f0c2eb1ee740bd8a901fe49699579183712e9485a7580205b3334823154d0e72dd896aad669e0
|
7
|
+
data.tar.gz: 840f26d770194bb6d32e2243fe61f18d39bccd537fe1cc144e1935ac2ba804ca78d887b62e1c31c2603f45f01b2cbd199e5b9eaeb00fe00758a6ffe96ecd2ad6
|
data/lib/namero/board.rb
CHANGED
data/lib/namero/solver.rb
CHANGED
@@ -11,7 +11,7 @@ module Namero
|
|
11
11
|
def solve
|
12
12
|
fill_candidates
|
13
13
|
loop do
|
14
|
-
idx = updated_candidate_queue.
|
14
|
+
idx = updated_candidate_queue.first
|
15
15
|
unless idx
|
16
16
|
extensions.each do |ex|
|
17
17
|
ex.solve(board, updated_candidate_queue)
|
@@ -38,19 +38,19 @@ module Namero
|
|
38
38
|
def fill_candidate_for(v)
|
39
39
|
board[v.index, :row].each do |v2|
|
40
40
|
unless v2.value
|
41
|
-
v2.candidates
|
41
|
+
v2.candidates.delete(v.value)
|
42
42
|
updated_candidate_queue << v2.index
|
43
43
|
end
|
44
44
|
end
|
45
45
|
board[v.index, :column].each do |v2|
|
46
46
|
unless v2.value
|
47
|
-
v2.candidates
|
47
|
+
v2.candidates.delete(v.value)
|
48
48
|
updated_candidate_queue << v2.index
|
49
49
|
end
|
50
50
|
end
|
51
51
|
board[v.index, :block].each do |v2|
|
52
52
|
unless v2.value
|
53
|
-
v2.candidates
|
53
|
+
v2.candidates.delete(v.value)
|
54
54
|
updated_candidate_queue << v2.index
|
55
55
|
end
|
56
56
|
end
|
data/lib/namero/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: namero
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masataka Pocke Kuwabara
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
90
|
- !ruby/object:Gem::Version
|
91
91
|
version: '0'
|
92
92
|
requirements: []
|
93
|
-
rubygems_version: 3.0.
|
93
|
+
rubygems_version: 3.2.0.pre1
|
94
94
|
signing_key:
|
95
95
|
specification_version: 4
|
96
96
|
summary: ''
|