namero 0.0.4 → 0.0.5
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 +17 -0
- data/lib/namero/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6b43e5791eeddd5fd52e44141a609fc97eb76da497ab686c6add7fb6e6f0f64
|
4
|
+
data.tar.gz: 5f5bc91d16f0ad5556f0a69cbb0cb44c81a441f24c76394a184eb88e98aa0f0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b18163566d9b80b8855640eca1ef165d6a3cb29e24f453dbda0185da6582eaa65a00727c46616010cfca809c0dfb91df5deb3f602e8e81093dbce04f2673d02
|
7
|
+
data.tar.gz: 7faaf576f63e75bb34ab0ce3670454320a5f5b3ba65522fe5bc17f549ffa713506aa284e158dbd4b0e52e7c80235c8a52983afbd1c11f978b595a0fd69c919ab
|
data/lib/namero/board.rb
CHANGED
@@ -17,6 +17,23 @@ module Namero
|
|
17
17
|
Namero::Board.new(n: n, values: values)
|
18
18
|
end
|
19
19
|
|
20
|
+
# [
|
21
|
+
# nil, nil, 4, nil,
|
22
|
+
# nil, nil, nil, 1,
|
23
|
+
# 4, nil, nil, nil,
|
24
|
+
# 2, 1, nil, nil,
|
25
|
+
# ]
|
26
|
+
def self.load_from_array(array, n)
|
27
|
+
values = array.map.with_index do |v, idx|
|
28
|
+
if v
|
29
|
+
Namero::Value.new(value: v, candidates: [v], index: idx)
|
30
|
+
else
|
31
|
+
Namero::Value.new(value: nil, candidates: (1..n).to_a, index: idx)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
Namero::Board.new(n: n, values: values)
|
35
|
+
end
|
36
|
+
|
20
37
|
# n: Integer
|
21
38
|
# values: Array<Integer>
|
22
39
|
def initialize(n:, values: Array.new(n**2))
|
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.5
|
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: 2020-05-
|
11
|
+
date: 2020-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|