codebreaker_karolina 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/codebreaker_karolina/version.rb +1 -1
- data/lib/modules/game.rb +2 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f2123ff89ac085c2aa4bd9ad405de0ccec2b5a177c9f16efac913fef78aa753
|
4
|
+
data.tar.gz: c23125068be503263c22a5b6a59785c619a263048db69532a932426994122091
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ef256a67685388fcbb14385c76d7658374c88dd3733d0cfeea818568ec0a7bbefcec3fee93b26465135a8caf559fc28b51d0fa0e9609498f27ae87cfc0b4cb8
|
7
|
+
data.tar.gz: ccc12cf943decc7cb4b5a1b22ffb61a84944b14cda75e9123f0155783d9aab0ff515771abd43e9993d54b46720b669e3b4ae1a29e9819a533fd4e412d0f39c0b
|
data/Gemfile.lock
CHANGED
data/lib/modules/game.rb
CHANGED
@@ -13,8 +13,6 @@ module CodebreakerKarolina
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def compare_code(guess)
|
16
|
-
return unless valid_code?(guess)
|
17
|
-
|
18
16
|
comparison_result(@secret_code.chars, guess.chars)
|
19
17
|
end
|
20
18
|
|
@@ -38,12 +36,12 @@ module CodebreakerKarolina
|
|
38
36
|
@hint.shuffle!.pop
|
39
37
|
end
|
40
38
|
|
41
|
-
private
|
42
|
-
|
43
39
|
def valid_code?(code)
|
44
40
|
!!code[/\A[1-6]{4}\z/]
|
45
41
|
end
|
46
42
|
|
43
|
+
private
|
44
|
+
|
47
45
|
def generate_code
|
48
46
|
Array.new(CODE_SIZE) { rand(NUM_RANGE) }.join
|
49
47
|
end
|