codebreaker_karolina 0.1.5 → 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/db_yaml.rb +1 -1
- data/lib/modules/game.rb +3 -5
- 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: 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/db_yaml.rb
CHANGED
data/lib/modules/game.rb
CHANGED
@@ -13,13 +13,11 @@ module CodebreakerKarolina
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def compare_code(guess)
|
16
|
-
return unless valid_code?(guess)
|
17
|
-
|
18
|
-
@user.used_attempts += 1
|
19
16
|
comparison_result(@secret_code.chars, guess.chars)
|
20
17
|
end
|
21
18
|
|
22
19
|
def win?(guess)
|
20
|
+
@user.used_attempts += 1
|
23
21
|
return true if @secret_code == guess
|
24
22
|
|
25
23
|
false
|
@@ -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
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codebreaker_karolina
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- drkarolina
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-09-
|
11
|
+
date: 2022-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fasterer
|