codebreaker_PI 0.6.4 → 0.6.5

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: b30612d628e14c6fc981b89a11a02741327163574297e655be631555ef4d1758
4
- data.tar.gz: e7277141e4bf7e34c470bf0a11bb23d45805e2226d830e49ceb3522705895085
3
+ metadata.gz: 4810214ae09c5898e8f02edea9eaa87f664d542f87e403870268c004fbf0f0a0
4
+ data.tar.gz: 7d29c80cd56cf4937a037a62b6f5f9a233abbfb07f71557cb63509ae1b67614a
5
5
  SHA512:
6
- metadata.gz: 9200a8b67579819df23308bad2a02b85e0c44e4c9f469ff3b17d8a7c27aaf234aaa2d25689264f30af48a9dc0f8319823f334be579fb0d479e8dec23abfc7429
7
- data.tar.gz: f5796badac894472b6a45485ce7656e8c079b9d3ccf628d4a5c3810b55bf52b0ac4a8a048ced0865d83fd235675dce43b5227a5f125a07dc6ff401533df007d7
6
+ metadata.gz: 38629beb71be0b8b21dd2b43629b7bd570f632fd0d88dcc0d2ffbd884236c130c8a6c62e8dddd6c37158fb2ffe16f0c9bd2b6c3c4384a44a62f9cd57860f6681
7
+ data.tar.gz: 66023a41dbf23c6510fd72e223f00a21f06682801052147ca6aed568461d865593ae946f3f598d7e986d173f0cb377ee3b67371bd97d99bfd7e2a9b739e51db3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- codebreaker_PI (0.6.4)
4
+ codebreaker_PI (0.6.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -16,7 +16,7 @@ GEM
16
16
  jaro_winkler (1.5.2)
17
17
  json (2.1.0)
18
18
  method_source (0.9.2)
19
- parallel (1.12.1)
19
+ parallel (1.13.0)
20
20
  parser (2.6.0.0)
21
21
  ast (~> 2.4.0)
22
22
  powerpack (0.1.2)
@@ -1,3 +1,3 @@
1
1
  module Codebreaker
2
- VERSION = "0.6.4"
2
+ VERSION = "0.6.5"
3
3
  end
data/lib/entities/game.rb CHANGED
@@ -14,7 +14,7 @@ module Codebreaker
14
14
  RANGE_OF_DIGITS = 1..6.freeze
15
15
  GUESS_CODE = { hint: 'hint', leave: 'exit' }.freeze
16
16
 
17
- attr_reader :got_hints, :secret_code, :name, :hints_total, :have_hints, :attempts_total, :hints_used, :attempts_used, :difficulty, :winner, :attempts_left
17
+ attr_reader :date, :got_hints, :secret_code, :name, :hints_total, :have_hints, :attempts_total, :hints_used, :attempts_used, :difficulty, :winner, :attempts_left
18
18
  attr_accessor :errors
19
19
 
20
20
  def game_options(user_difficulty:, player:)
@@ -49,6 +49,11 @@ module Codebreaker
49
49
  remove_instance_variable(:@have_hints) if @have_hints
50
50
  end
51
51
 
52
+ def secret_code
53
+ @secret_code ||= Array.new(AMOUNT_DIGITS) { rand(RANGE_OF_DIGITS) }.join('')
54
+ convert_to_array(@secret_code)
55
+ end
56
+
52
57
  private
53
58
 
54
59
  def hint?(input)
@@ -98,11 +103,6 @@ module Codebreaker
98
103
  user_code == secret_code
99
104
  end
100
105
 
101
- def secret_code
102
- @secret_code ||= Array.new(AMOUNT_DIGITS) { rand(RANGE_OF_DIGITS) }.join('')
103
- convert_to_array(@secret_code)
104
- end
105
-
106
106
  def guessing(user_code)
107
107
  count_attempt
108
108
  @date = Time.new and return @winner = true if compare_with_right_code(user_code)
@@ -16,9 +16,10 @@ module Codebreaker
16
16
  row << i.name
17
17
  row << i.difficulty
18
18
  row << i.attempts_total
19
- row << i.attempts_used
19
+ row << i.attempts_left
20
20
  row << i.hints_total
21
- row << i.hints_used
21
+ row << i.have_hints
22
+ row << i.date
22
23
  rows << row
23
24
  end
24
25
  rows
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codebreaker_PI
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Pauls