codebreaker_Bavykin 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/codebreaker/game.rb +8 -2
- data/lib/codebreaker/version.rb +1 -1
- data/lib/codebreaker.rb +0 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8cb956ecb11c5569314bca619220dac1ddf062b5
|
4
|
+
data.tar.gz: 3b42e98a6bd69dd79c54083f35ecda6ec7f021b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72f62791b07c7ae609e80d532cb9a8c225891cf7466bec04dc9a0903713292270c84bacbaf7e28726d1ef6a27b5b64ccbbf472cf30f4bd763982457fd158667f
|
7
|
+
data.tar.gz: bdf7eefacafe811d5de8bbe13ef10d5556e4998c09ab2bd026ea5fc76a207d7241060a4cd38198af149fcd130c4a76a80c699741c5540bf34c73908aac776f3b
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
|
4
|
+
codebreaker_Bavykin (0.1.1)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -48,7 +48,7 @@ PLATFORMS
|
|
48
48
|
|
49
49
|
DEPENDENCIES
|
50
50
|
bundler (~> 1.16)
|
51
|
-
|
51
|
+
codebreaker_Bavykin!
|
52
52
|
pry (~> 0.11.3)
|
53
53
|
rake (~> 10.0)
|
54
54
|
rspec (~> 3.0)
|
data/lib/codebreaker/game.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
2
|
+
|
3
3
|
module Codebreaker
|
4
4
|
|
5
5
|
class Game
|
@@ -12,7 +12,13 @@ module Codebreaker
|
|
12
12
|
attr_reader :attempts, :hints, :secret_code
|
13
13
|
attr_accessor :user_code
|
14
14
|
|
15
|
-
def initialize(
|
15
|
+
def initialize(secret_code, attempts, hints)
|
16
|
+
@secret_code = secret_code
|
17
|
+
@attempts = attempts
|
18
|
+
@hints = hints
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.generate_game_data(difficulty = :easy)
|
16
22
|
@secret_code = Array.new(4) { rand(1..6) }
|
17
23
|
@attempts = DIFFICULTIES.dig(difficulty, :attempts)
|
18
24
|
@hints = secret_code.shuffle.take(DIFFICULTIES.dig(difficulty, :hints))
|
data/lib/codebreaker/version.rb
CHANGED
data/lib/codebreaker.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codebreaker_Bavykin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitriy Bavykin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-12-
|
11
|
+
date: 2017-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|