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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: acab791ab024b34db88dbaab84c520938e9a02fafded7a1c0e62707c36cc78b0
4
- data.tar.gz: 53d843deb1049149b5e855a0f67a9bbc92bc15f779cb84b4d067719a007a31cf
3
+ metadata.gz: 3f5cfc4a3e32eddfbe968444bc20f5e93431281cbbdde71f68b755b74a41b136
4
+ data.tar.gz: f55182f7559c8b222e69094aab0a4300b8b99ad8765038df6ddb2e3205dad60e
5
5
  SHA512:
6
- metadata.gz: 981f93c1bd5f95d6966c2e62be4433526f180263976a2d07fde842863ba9288608456cc73e53f6f05e34cdce8264d7ee2c5524e6817e6d8218eebd8c4a4dd07f
7
- data.tar.gz: f58998fd6b4f71dd9c9c3574ee7143cedf172cee86396b41dd178adbbcf462031158362720c0415fc3782c6fdb5c4abea77c3f55932bea93e0f47fd065133224
6
+ metadata.gz: 9e421ccbe77116c7aff55c35fe39a270c13dc9b68b88d4b62e40e9a79814b639918031d44debfc169a79606fb98bf98fd69c1758f1e51eeb2489268b8a2cff05
7
+ data.tar.gz: 400f876338ac478c57b8b2fbadb443f46fa65af14b15d279d63ea03df80cdf6fa3965400ecf7f5a910b3e8e40e7df32112052bfcafcdc60e7780972f255bd386
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- codebreaker_al (0.1.1)
4
+ codebreaker_al (0.1.2)
5
5
  i18n (~> 1.10.0)
6
6
  rake (~> 13.0.6)
7
7
  table_print (~> 1.5.7)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Codebreaker
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end
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.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-07-14 00:00:00.000000000 Z
11
+ date: 2022-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fasterer