codebreaker_karolina 0.1.5 → 0.1.8

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: 7453baca50feaa631814b88629ecd461c00a09ed14e3bd57da5ad842d8ddca36
4
- data.tar.gz: 0e8567cb5e05658071c12af9c4f91c5828db7b4a39d446dd4a9d25f4f1ff788b
3
+ metadata.gz: 4f2123ff89ac085c2aa4bd9ad405de0ccec2b5a177c9f16efac913fef78aa753
4
+ data.tar.gz: c23125068be503263c22a5b6a59785c619a263048db69532a932426994122091
5
5
  SHA512:
6
- metadata.gz: 57f8fb6bd70d1bd16d6af68737c745a8b12d2b970f28e82c88479a26e7433f93fc9deb47126218ec2366c25da593e5ea608a01f566b6f5178fda56753d041ed9
7
- data.tar.gz: 70d969087c130c05791bfeb42557b053f0d1b3da9635a0c3f3aa39254a1cefffb3d212880be144036303f453678716645982d9ee48ab326b7bfc8c0f9146d3c1
6
+ metadata.gz: 8ef256a67685388fcbb14385c76d7658374c88dd3733d0cfeea818568ec0a7bbefcec3fee93b26465135a8caf559fc28b51d0fa0e9609498f27ae87cfc0b4cb8
7
+ data.tar.gz: ccc12cf943decc7cb4b5a1b22ffb61a84944b14cda75e9123f0155783d9aab0ff515771abd43e9993d54b46720b669e3b4ae1a29e9819a533fd4e412d0f39c0b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- codebreaker_karolina (0.1.5)
4
+ codebreaker_karolina (0.1.8)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,3 +1,3 @@
1
1
  module CodebreakerKarolina
2
- VERSION = '0.1.5'.freeze
2
+ VERSION = '0.1.8'.freeze
3
3
  end
@@ -23,7 +23,7 @@ module CodebreakerKarolina
23
23
  private
24
24
 
25
25
  def load_file_stats
26
- return unless File.file?(FILE_NAME)
26
+ return [] unless File.file?(FILE_NAME)
27
27
 
28
28
  YAML.load_stream(File.open(FILE_NAME))
29
29
  end
data/lib/modules/game.rb CHANGED
@@ -13,13 +13,11 @@ module CodebreakerKarolina
13
13
  end
14
14
 
15
15
  def compare_code(guess)
16
- return unless valid_code?(guess)
17
-
18
- @user.used_attempts += 1
19
16
  comparison_result(@secret_code.chars, guess.chars)
20
17
  end
21
18
 
22
19
  def win?(guess)
20
+ @user.used_attempts += 1
23
21
  return true if @secret_code == guess
24
22
 
25
23
  false
@@ -38,12 +36,12 @@ module CodebreakerKarolina
38
36
  @hint.shuffle!.pop
39
37
  end
40
38
 
41
- private
42
-
43
39
  def valid_code?(code)
44
40
  !!code[/\A[1-6]{4}\z/]
45
41
  end
46
42
 
43
+ private
44
+
47
45
  def generate_code
48
46
  Array.new(CODE_SIZE) { rand(NUM_RANGE) }.join
49
47
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codebreaker_karolina
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - drkarolina
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-11 00:00:00.000000000 Z
11
+ date: 2022-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fasterer