codebreaker_ruban 0.3.6 → 0.3.7
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/app/entities/game.rb +3 -3
- data/lib/codebreaker_ruban/version.rb +1 -1
- 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: c870cda099e3608be64a9ec4028728f10e7e4208020f39fe315f0b2617265e0f
|
4
|
+
data.tar.gz: 0e7515721bf17cda5b5b3cb616c0ceacd4f9cf1a1a7a0dd06679924cc24c053a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 616a9bef41a1896472ab9ca5394ef5ba43af97636b78d434fd3a0608efcecf3bc95602a2bd77a24be803c27a60aec63684e4c0a25a28930d85319018b26facdc
|
7
|
+
data.tar.gz: ff31ecf608a160dd6880335abeb4dd3b41f757ed72f30e404d3fc24c7e451f7c9e06151dcca5f1a9bf99128632ec9afeb3d5e5cebd35fff788409749bca46ac1
|
data/Gemfile.lock
CHANGED
data/lib/app/entities/game.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
module CodebreakerRuban
|
4
4
|
class Game
|
5
5
|
include Validation
|
6
|
-
attr_reader :difficulty, :attempts_total, :hints_total, :user, :secret_code, :datetime
|
6
|
+
attr_reader :difficulty, :attempts_total, :hints_total, :user, :hints_showeded, :secret_code, :datetime
|
7
7
|
attr_accessor :attempts_used, :hints_used, :errors, :guess_code
|
8
8
|
|
9
9
|
LENGTH_GUESS = 4
|
@@ -16,7 +16,6 @@ module CodebreakerRuban
|
|
16
16
|
|
17
17
|
def initialize(difficulty, user)
|
18
18
|
@user = user
|
19
|
-
binding.pry
|
20
19
|
@difficulty = difficulty[:difficulty]
|
21
20
|
@secret_code = generator_secret_code
|
22
21
|
@attempts_total = difficulty[:attempts_total]
|
@@ -24,6 +23,7 @@ module CodebreakerRuban
|
|
24
23
|
@hint = secret_code.clone.shuffle
|
25
24
|
@hints_used = 0
|
26
25
|
@attempts_used = 0
|
26
|
+
@hints_showed = []
|
27
27
|
@datetime = Time.now
|
28
28
|
@guess_code = nil
|
29
29
|
@errors = []
|
@@ -53,7 +53,7 @@ module CodebreakerRuban
|
|
53
53
|
def hint_use
|
54
54
|
if @hints_used < @hints_total
|
55
55
|
@hints_used += 1
|
56
|
-
@hint.pop
|
56
|
+
@hints_showed << @hint.pop
|
57
57
|
else
|
58
58
|
clear_errors
|
59
59
|
errors << Message.error_guess_code
|