codebreaker_karolina 0.1.7 → 0.1.9

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: 7e440de80b751f3633dd4616e59d30ff1b11b340825e049bd02ba61e6fc0f902
4
- data.tar.gz: 1b5bd67e620806b872373eba4c0220c25774c30fdbee8ac78aa89651e549d319
3
+ metadata.gz: 25af9652814739ad5415aed30dec4d03321c9a7aaf7a7943f9a4fddf507554cc
4
+ data.tar.gz: 6d971d2654565b559dec7a1ea585d007545d6225fb65683e71afbbf9aaad45d0
5
5
  SHA512:
6
- metadata.gz: 5ac23599134384455b606a6d5682b6003061950a22f31b2b3c31ef59e04f45b744e3316790cdb341c17dcbf12917d4d8121c0d51ef857c09b6551bb51710ab97
7
- data.tar.gz: 462ea30047e9af6ee6306a708cc9c50e4213fec6d89d8483d18dc07c32bdbeffa58069549bfa209fa5ddfb54649f4a4463abd3833d445c4440906f53f4bb6892
6
+ metadata.gz: 61fc6e37e0e56bbd088902bf8ae17923b8f7822a50e013e0e257b09e9be1f52bb37cb15938a06cc0f9c7bc12aae5af54a08e4a1cba75ae880381e9f79e911a2d
7
+ data.tar.gz: ebe33dadb52443d0cc5cab2c0dd56880765b27a42ed60ace40d609820bb3afff7cf5b21a51da2ae32d1a95d9f123220301c2dec266aa052cb1e69bfaa50d4247
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- codebreaker_karolina (0.1.7)
4
+ codebreaker_karolina (0.1.9)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
Binary file
Binary file
Binary file
Binary file
@@ -1,3 +1,3 @@
1
1
  module CodebreakerKarolina
2
- VERSION = '0.1.7'.freeze
2
+ VERSION = '0.1.9'.freeze
3
3
  end
data/lib/modules/game.rb CHANGED
@@ -1,20 +1,20 @@
1
1
  require_relative '../constants'
2
2
  require_relative 'user'
3
3
  require_relative 'difficulty'
4
+ require 'date'
4
5
  module CodebreakerKarolina
5
6
  class Game
6
7
  include CodebreakerConstants
7
8
  attr_accessor :user, :difficulty
8
- attr_reader :secret_code
9
+ attr_reader :secret_code, :date
9
10
 
10
11
  def start
12
+ @date = DateTime.now
11
13
  @secret_code = generate_code.freeze
12
14
  @hint = @secret_code.chars.uniq
13
15
  end
14
16
 
15
17
  def compare_code(guess)
16
- return unless valid_code?(guess)
17
-
18
18
  comparison_result(@secret_code.chars, guess.chars)
19
19
  end
20
20
 
@@ -38,12 +38,12 @@ module CodebreakerKarolina
38
38
  @hint.shuffle!.pop
39
39
  end
40
40
 
41
- private
42
-
43
41
  def valid_code?(code)
44
42
  !!code[/\A[1-6]{4}\z/]
45
43
  end
46
44
 
45
+ private
46
+
47
47
  def generate_code
48
48
  Array.new(CODE_SIZE) { rand(NUM_RANGE) }.join
49
49
  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.7
4
+ version: 0.1.9
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-13 00:00:00.000000000 Z
11
+ date: 2022-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fasterer
@@ -129,6 +129,10 @@ files:
129
129
  - codebreaker_karolina-0.1.2.gem
130
130
  - codebreaker_karolina-0.1.3.gem
131
131
  - codebreaker_karolina-0.1.4.gem
132
+ - codebreaker_karolina-0.1.5.gem
133
+ - codebreaker_karolina-0.1.6.gem
134
+ - codebreaker_karolina-0.1.7.gem
135
+ - codebreaker_karolina-0.1.8.gem
132
136
  - lib/codebreaker_karolina.rb
133
137
  - lib/codebreaker_karolina/version.rb
134
138
  - lib/constants.rb