andrii_codebreaker 0.1.7 → 0.1.8

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: 614726c17f68e0208588be0daa78170ff2dca52f3cbb48017faa565b96673a0c
4
- data.tar.gz: fd3c636ff49aaace2fda7055aa2ce90155709e0c56edb889cad671d6e4f43105
3
+ metadata.gz: 1a01bba68d09ade8b529e4f4ced95cdbcb32a89d6dc2dc38a9b3f4f89d9bcad6
4
+ data.tar.gz: b19b78984073b7017509da2df5159bcc422ff6359432a88257e84a517369e95b
5
5
  SHA512:
6
- metadata.gz: 0c5603c20de947e67d699355cec83a2f4160da98d133c8516b10bd45cff5ccfc76600092f9ef74ab040d05631ae8032ec08147908dcee0775e4a2f202e618cc3
7
- data.tar.gz: b6ae17bb6609a3ea2b6dbe9dd78e024d425c31b1428dce613660ab004389bd93d17dd2235b222fe591db4fa6fb2aea3c2b08717f39009a4ecb9ba13f61d96ebc
6
+ metadata.gz: b51935c0eb2382f41d9fb8c6859d507eaf7cf21ca7aad9a9f386262ad9b95130af5fdceab79ee424a7b906c934a906bf9358e49316b73e588aebadd5b613939f
7
+ data.tar.gz: 594d24a0cd286e63d0b6ab241080d629d4b2bc9bbc5648b57cdae0e159997381587ed7e90c1063e6bd5cc75ab99e6449bbff638e70c2b9c0a43b01bff354d15c
@@ -5,7 +5,7 @@ module AndriiCodebreaker
5
5
  include Statistic
6
6
  include Constant
7
7
 
8
- attr_reader :player_name, :difficulties, :attempts_total, :hints_total, :secret_code
8
+ attr_reader :player_name, :difficulties, :attempts_total, :hints_total, :secret_code, :difficulty
9
9
  attr_accessor :hints_left, :attempts_left, :secret_code_copy
10
10
 
11
11
  CONST_COMMAND = {
@@ -27,6 +27,7 @@ module AndriiCodebreaker
27
27
  @secret_code_copy = @secret_code.chars
28
28
  @hints_total = @difficulties.hint
29
29
  @attempts_total = @difficulties.attempts
30
+ @difficulty = @difficulties.difficulty
30
31
  end
31
32
 
32
33
  def hints
@@ -60,7 +61,7 @@ module AndriiCodebreaker
60
61
 
61
62
  code_guess.each_index do |i|
62
63
  if code_guess[i] == secret_code[i]
63
- result += '+'
64
+ result += PLUS
64
65
  index << i
65
66
  end
66
67
  end
@@ -72,7 +73,7 @@ module AndriiCodebreaker
72
73
  code_guess.each do |i|
73
74
  next unless secret_code.include?(i)
74
75
 
75
- result << MINUS
76
+ result += MINUS
76
77
  index = secret_code.index(i)
77
78
  secret_code.delete_at(index)
78
79
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AndriiCodebreaker
4
- VERSION = '0.1.7'
4
+ VERSION = '0.1.8'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: andrii_codebreaker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrii