codebreaker_al 0.1.1 → 0.1.2
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/version.rb +1 -1
- data/lib/game.rb +4 -2
- 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: 3f5cfc4a3e32eddfbe968444bc20f5e93431281cbbdde71f68b755b74a41b136
|
4
|
+
data.tar.gz: f55182f7559c8b222e69094aab0a4300b8b99ad8765038df6ddb2e3205dad60e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e421ccbe77116c7aff55c35fe39a270c13dc9b68b88d4b62e40e9a79814b639918031d44debfc169a79606fb98bf98fd69c1758f1e51eeb2489268b8a2cff05
|
7
|
+
data.tar.gz: 400f876338ac478c57b8b2fbadb443f46fa65af14b15d279d63ea03df80cdf6fa3965400ecf7f5a910b3e8e40e7df32112052bfcafcdc60e7780972f255bd386
|
data/Gemfile.lock
CHANGED
data/lib/codebreaker/version.rb
CHANGED
data/lib/game.rb
CHANGED
@@ -11,7 +11,7 @@ module Codebreaker
|
|
11
11
|
public
|
12
12
|
|
13
13
|
attr_reader :user, :attempts, :total_attempts, :hints, :total_hints, :level
|
14
|
-
attr_accessor :status
|
14
|
+
attr_accessor :status, :taken_hints
|
15
15
|
|
16
16
|
GAME_DIFFICULTIES = { simple: { attempts: 15, hints: 2 }, medium: { attempts: 10, hints: 1 },
|
17
17
|
hell: { attempts: 5, hints: 1 } }.freeze
|
@@ -26,6 +26,7 @@ module Codebreaker
|
|
26
26
|
@user = User.new(user_name)
|
27
27
|
@secret_code = SecretCode.new(generate_secret_code).value
|
28
28
|
@status = nil
|
29
|
+
@taken_hints = []
|
29
30
|
end
|
30
31
|
|
31
32
|
def add_hints_attempts(level)
|
@@ -41,7 +42,8 @@ module Codebreaker
|
|
41
42
|
|
42
43
|
@hints -= 1
|
43
44
|
|
44
|
-
@secret_code.digits.shuffle.pop
|
45
|
+
@taken_hints << @secret_code.digits.shuffle.pop
|
46
|
+
@taken_hints.last
|
45
47
|
end
|
46
48
|
|
47
49
|
def guess(user_variant)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codebreaker_al
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anastasiia Losytska
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fasterer
|