codebreaker2018 0.3.4.1 → 0.3.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/codebreaker/game.rb +3 -2
- data/lib/codebreaker/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: a5f8870aa186256c3bf435c3bedbedc9f3acbfe6dbeab6cabb7561096dd47ce1
|
4
|
+
data.tar.gz: f90c5f18c25194c6bd4020a7e9a16f1da59cb223813d12a2bb27a9f7cb39a5b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 570b8359fc5cc3ffe4782b3a55e3da6719ce67d5699538662be2a6bbb92bc62f23996a46f3adcecbaca8a5c5efd6e41db4aa2c6baf01cf110391632126c0d984
|
7
|
+
data.tar.gz: 5583cda2e4794cc6bc6643ed61f7467220b955eef740769f5b48984c15676ad7542749a59d9916aef43bcf2e682f41b58985c24b18e2bf59cc922b1b15cee930
|
data/lib/codebreaker/game.rb
CHANGED
@@ -48,7 +48,9 @@ module Codebreaker
|
|
48
48
|
private
|
49
49
|
|
50
50
|
def check_configuration
|
51
|
+
levels = [SIMPLE_LEVEL, MIDDLE_LEVEL, HARD_LEVEL]
|
51
52
|
raise message['errors']['fail_configuration'] if configuration.any?(&:nil?)
|
53
|
+
raise message['errors']['unknown_level'] unless levels.include?(configuration.level)
|
52
54
|
begin
|
53
55
|
raise if configuration.max_attempts < 1 || configuration.max_hints.negative?
|
54
56
|
rescue
|
@@ -106,8 +108,7 @@ module Codebreaker
|
|
106
108
|
level_rates = case configuration.level
|
107
109
|
when SIMPLE_LEVEL then [TEN_POINTS, ZERO_POINTS]
|
108
110
|
when MIDDLE_LEVEL then [TWENTY_POINTS, TWENTY_POINTS]
|
109
|
-
|
110
|
-
else raise message['errors']['unknown_level']
|
111
|
+
else [FIFTY_POINTS, ONE_HUNDRED_POINTS]
|
111
112
|
end
|
112
113
|
|
113
114
|
attempt_rate, hint_rate = level_rates
|
data/lib/codebreaker/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codebreaker2018
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.4.
|
4
|
+
version: 0.3.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladislav Trotsenko
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-06-
|
11
|
+
date: 2018-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|