dk_codebreaker 0.1.9.2 → 0.1.9.3
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 +4 -4
- data/README.md +3 -0
- data/lib/dk_codebreaker/game.rb +4 -4
- data/lib/dk_codebreaker/version.rb +1 -1
- metadata +1 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86c6b05fe62a9e0a8df36b9ff540bb82be878bbe
|
4
|
+
data.tar.gz: cfb8f6abef8f07c3fc9ed6b3423d70cffad517c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b93af58284e61dde22692c88c314ddf72fb9b623a7553bb82c13732b9b5538297fa12ca4d0d20e8b96ee4f3416af055718870aaad082e64f3d783f1aaa097a38
|
7
|
+
data.tar.gz: 2f3b55cb7f7ca5e10ecffdccb085d348d25e7b8bf1741374f15d88dda7d5df8047855c907b7a1d0ef0d8b136afc690d2348e650007b86789da8f7e0d6d351cd4
|
data/README.md
CHANGED
@@ -60,11 +60,14 @@ game.hint_status
|
|
60
60
|
game.attempt
|
61
61
|
game.player
|
62
62
|
game.player=
|
63
|
+
game.attempts
|
64
|
+
game.attempts=
|
63
65
|
```
|
64
66
|
|
65
67
|
|
66
68
|
## Implementations
|
67
69
|
[codebreaker_console](https://github.com/DenKey/codebreaker_console)
|
70
|
+
|
68
71
|
[codebreaker_web](https://github.com/DenKey/codebreaker_web)
|
69
72
|
|
70
73
|
## Contributing
|
data/lib/dk_codebreaker/game.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module DkCodebreaker
|
2
2
|
class Game
|
3
3
|
attr_reader :hint_status, :attempt
|
4
|
-
attr_accessor :player
|
4
|
+
attr_accessor :player, :attempts
|
5
5
|
|
6
6
|
def initialize player = nil, attempts = 10
|
7
7
|
@submit_code = nil
|
@@ -9,7 +9,7 @@ module DkCodebreaker
|
|
9
9
|
@player = player
|
10
10
|
@attempt = 1
|
11
11
|
@hint_status = false
|
12
|
-
@
|
12
|
+
@attempts = attempts
|
13
13
|
@last_result = nil
|
14
14
|
end
|
15
15
|
|
@@ -26,7 +26,7 @@ module DkCodebreaker
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def guess submit_code
|
29
|
-
if @attempt < @
|
29
|
+
if @attempt < @attempts
|
30
30
|
if submit_code.is_a? String
|
31
31
|
return :less_then_four if submit_code.size < 4
|
32
32
|
submit_code = submit_code[0,4] if submit_code.size > 4
|
@@ -57,7 +57,7 @@ module DkCodebreaker
|
|
57
57
|
player: @player,
|
58
58
|
result: @last_result,
|
59
59
|
attempt: @attempt,
|
60
|
-
attempts: @
|
60
|
+
attempts: @attempts,
|
61
61
|
time: Time.new.strftime("%m/%d/%Y/%H/%M")
|
62
62
|
}
|
63
63
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dk_codebreaker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.9.
|
4
|
+
version: 0.1.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Den Key
|
@@ -120,4 +120,3 @@ signing_key:
|
|
120
120
|
specification_version: 4
|
121
121
|
summary: Codebreaker is a logic game.
|
122
122
|
test_files: []
|
123
|
-
has_rdoc:
|