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 +4 -4
- data/Gemfile.lock +1 -1
- data/codebreaker_karolina-0.1.5.gem +0 -0
- data/codebreaker_karolina-0.1.6.gem +0 -0
- data/codebreaker_karolina-0.1.7.gem +0 -0
- data/codebreaker_karolina-0.1.8.gem +0 -0
- data/lib/codebreaker_karolina/version.rb +1 -1
- data/lib/modules/game.rb +5 -5
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25af9652814739ad5415aed30dec4d03321c9a7aaf7a7943f9a4fddf507554cc
|
4
|
+
data.tar.gz: 6d971d2654565b559dec7a1ea585d007545d6225fb65683e71afbbf9aaad45d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61fc6e37e0e56bbd088902bf8ae17923b8f7822a50e013e0e257b09e9be1f52bb37cb15938a06cc0f9c7bc12aae5af54a08e4a1cba75ae880381e9f79e911a2d
|
7
|
+
data.tar.gz: ebe33dadb52443d0cc5cab2c0dd56880765b27a42ed60ace40d609820bb3afff7cf5b21a51da2ae32d1a95d9f123220301c2dec266aa052cb1e69bfaa50d4247
|
data/Gemfile.lock
CHANGED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
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.
|
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-
|
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
|