codebreaker-d3n 0.1.9 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f49dbd4c3857d46763fce325d8124ebd3122d043a9e24aa6b26cfea374622e0f
4
- data.tar.gz: dfa8bbbd2f0202af790ce69ff3dd47e816ccc1d09c385b315d854baa94e0772a
3
+ metadata.gz: 1501eb4f3a042fd41144cd9dcd24b28153070529fe2e7ce3e91c9a8ef9ae1ce9
4
+ data.tar.gz: ddc028c8a615ed0f4e3a4272e4b88c54fec253cbac5d7aa8e709678209ca43f1
5
5
  SHA512:
6
- metadata.gz: 8951da49533f949d34f2ee6c728dccbdcd0c13d79d95abada257925a6588fd6d163691cc960d165bedb1f488140dec2dbbb254e2b439bffe54b850a61528ae9f
7
- data.tar.gz: 5ebcbd91edb9680a73262af49d591ed346d230ae86897302050b7776482e7acff3dfed847b22eed0041e1bcbbf6c9ba4d0d71df988c27e0346efaadf60ce3e03
6
+ metadata.gz: dfab6fcaeef82f9a3eb08f1318e6495816e0d0569180b144e03776824b1bc9f59187346dab331112081357eb7ac744c44674049a9b2e66ca25277570d61871c0
7
+ data.tar.gz: ef3555eb759643b79ffe714f450dfdc1c8994e05efd824cb0dfd99e6b77d35c40a287a3c1712a83f5993cd136fc8d843fd554a628c01616da40b2620ec5b055f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- codebreaker-d3n (0.1.8)
4
+ codebreaker-d3n (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -6,6 +6,7 @@ module Codebreaker
6
6
  attr_reader :difficulty, :errors, :secret_code, :result, :hints, :attempts_total, :hint_keeper,
7
7
  :attempts_used, :attempts_available, :hints_total, :hints_used, :hints_available
8
8
 
9
+ TIME_FORMAT = '%d %b %Y - %H:%M:%S'
9
10
  CODE_DIGITS = (1..6).freeze
10
11
  CODE_LENGTH = 4
11
12
  MATCH = '+'
@@ -42,6 +43,8 @@ module Codebreaker
42
43
  def start
43
44
  @code = @secret_code.dup
44
45
  @attempts -= 1
46
+ attempts_calculations
47
+ hints_calculations
45
48
  matches_result = check_matches
46
49
  presence_result = check_presence
47
50
  @result = (matches_result + presence_result).join
@@ -92,7 +95,8 @@ module Codebreaker
92
95
  attempts_total: LEVELS.dig(@difficulty.to_sym, :attempts),
93
96
  attempts_used: LEVELS.dig(@difficulty.to_sym, :attempts) - @attempts,
94
97
  hints_total: LEVELS.dig(@difficulty.to_sym, :hints),
95
- hints_used: LEVELS.dig(@difficulty.to_sym, :hints) - @hints.size
98
+ hints_used: LEVELS.dig(@difficulty.to_sym, :hints) - @hints.size,
99
+ time: Time.now.strftime(TIME_FORMAT)
96
100
  }
97
101
  end
98
102
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Codebreaker
4
- VERSION = '0.1.9'
4
+ VERSION = '0.2.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codebreaker-d3n
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denny_Dee