dk_codebreaker 0.1.9.1 → 0.1.9.2
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 +13 -3
- data/lib/dk_codebreaker/game.rb +8 -3
- data/lib/dk_codebreaker/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1abe7454bca318a13ca7b4bea3965a4eeaa32aab
|
4
|
+
data.tar.gz: c4c8fa78ccbae9c9f100e90f64035368c7c3c72a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a740bebd32d255410ef01bc3c3cd9769ab3ad5c0f999d54c0a2fdbc396a72a40005985571022e5d55ea0e8fa53031ace36a92df3db130dd8bb809f21a560acb0
|
7
|
+
data.tar.gz: 9bd5217199f4dc5befd7ed68482e330039e6764d7fd5c7a0472ce1c1ad812c57ec9f278683268093e1ad40eeb1f38622c02cc942cb7f27f77c2031bee8e4a47b
|
data/README.md
CHANGED
@@ -22,7 +22,7 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
$ gem install dk_codebreaker
|
24
24
|
|
25
|
-
##
|
25
|
+
## Quick documentation
|
26
26
|
|
27
27
|
```ruby
|
28
28
|
# create game instace, it get user name and attempts
|
@@ -47,7 +47,12 @@ game.guess user_code
|
|
47
47
|
# return [hint String]
|
48
48
|
game.hint
|
49
49
|
|
50
|
-
# Return
|
50
|
+
# Return Hash with user data {player,result,attempt,attempts,time}
|
51
|
+
# :player - username
|
52
|
+
# :result - last game result
|
53
|
+
# :attempt - current attempt number
|
54
|
+
# :attempts - limitation of trying
|
55
|
+
# :time - "%m/%d/%Y/%H/%M"
|
51
56
|
game.user_data
|
52
57
|
|
53
58
|
# Getters and Setters
|
@@ -57,9 +62,14 @@ game.player
|
|
57
62
|
game.player=
|
58
63
|
```
|
59
64
|
|
65
|
+
|
66
|
+
## Implementations
|
67
|
+
[codebreaker_console](https://github.com/DenKey/codebreaker_console)
|
68
|
+
[codebreaker_web](https://github.com/DenKey/codebreaker_web)
|
69
|
+
|
60
70
|
## Contributing
|
61
71
|
|
62
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
72
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/DenKey/dk_codebreaker
|
63
73
|
|
64
74
|
|
65
75
|
## License
|
data/lib/dk_codebreaker/game.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
module DkCodebreaker
|
2
2
|
class Game
|
3
|
-
attr_reader :hint_status
|
4
|
-
attr_reader :attempt
|
3
|
+
attr_reader :hint_status, :attempt
|
5
4
|
attr_accessor :player
|
6
5
|
|
7
6
|
def initialize player = nil, attempts = 10
|
@@ -54,7 +53,13 @@ module DkCodebreaker
|
|
54
53
|
end
|
55
54
|
|
56
55
|
def user_data
|
57
|
-
|
56
|
+
{
|
57
|
+
player: @player,
|
58
|
+
result: @last_result,
|
59
|
+
attempt: @attempt,
|
60
|
+
attempts: @limit,
|
61
|
+
time: Time.new.strftime("%m/%d/%Y/%H/%M")
|
62
|
+
}
|
58
63
|
end
|
59
64
|
|
60
65
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Den Key
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -120,3 +120,4 @@ signing_key:
|
|
120
120
|
specification_version: 4
|
121
121
|
summary: Codebreaker is a logic game.
|
122
122
|
test_files: []
|
123
|
+
has_rdoc:
|