codebreaker_karolina 0.1.4 → 0.1.7
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.3.gem +0 -0
- data/codebreaker_karolina-0.1.4.gem +0 -0
- data/lib/codebreaker_karolina/version.rb +1 -1
- data/lib/modules/db_yaml.rb +2 -0
- data/lib/modules/game.rb +2 -4
- data/lib/modules/user.rb +1 -3
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e440de80b751f3633dd4616e59d30ff1b11b340825e049bd02ba61e6fc0f902
|
4
|
+
data.tar.gz: 1b5bd67e620806b872373eba4c0220c25774c30fdbee8ac78aa89651e549d319
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ac23599134384455b606a6d5682b6003061950a22f31b2b3c31ef59e04f45b744e3316790cdb341c17dcbf12917d4d8121c0d51ef857c09b6551bb51710ab97
|
7
|
+
data.tar.gz: 462ea30047e9af6ee6306a708cc9c50e4213fec6d89d8483d18dc07c32bdbeffa58069549bfa209fa5ddfb54649f4a4463abd3833d445c4440906f53f4bb6892
|
data/Gemfile.lock
CHANGED
Binary file
|
Binary file
|
data/lib/modules/db_yaml.rb
CHANGED
data/lib/modules/game.rb
CHANGED
@@ -15,11 +15,11 @@ module CodebreakerKarolina
|
|
15
15
|
def compare_code(guess)
|
16
16
|
return unless valid_code?(guess)
|
17
17
|
|
18
|
-
@user.used_attempts += 1
|
19
18
|
comparison_result(@secret_code.chars, guess.chars)
|
20
19
|
end
|
21
20
|
|
22
21
|
def win?(guess)
|
22
|
+
@user.used_attempts += 1
|
23
23
|
return true if @secret_code == guess
|
24
24
|
|
25
25
|
false
|
@@ -41,9 +41,7 @@ module CodebreakerKarolina
|
|
41
41
|
private
|
42
42
|
|
43
43
|
def valid_code?(code)
|
44
|
-
|
45
|
-
|
46
|
-
false
|
44
|
+
!!code[/\A[1-6]{4}\z/]
|
47
45
|
end
|
48
46
|
|
49
47
|
def generate_code
|
data/lib/modules/user.rb
CHANGED
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.7
|
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-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fasterer
|
@@ -127,6 +127,8 @@ files:
|
|
127
127
|
- codebreaker_karolina-0.1.0.gem
|
128
128
|
- codebreaker_karolina-0.1.1.gem
|
129
129
|
- codebreaker_karolina-0.1.2.gem
|
130
|
+
- codebreaker_karolina-0.1.3.gem
|
131
|
+
- codebreaker_karolina-0.1.4.gem
|
130
132
|
- lib/codebreaker_karolina.rb
|
131
133
|
- lib/codebreaker_karolina/version.rb
|
132
134
|
- lib/constants.rb
|