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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 35525184bc14aec129f1e4aa5fc177cf5954957e
4
- data.tar.gz: 46480b3c65001ae1fd90c541107c4adf021516ca
3
+ metadata.gz: 8cb956ecb11c5569314bca619220dac1ddf062b5
4
+ data.tar.gz: 3b42e98a6bd69dd79c54083f35ecda6ec7f021b0
5
5
  SHA512:
6
- metadata.gz: 13c77c7c48a79626fda3ebb604055e351111c5dde5b635909876b8b65ef42b7fb770ee58bd5a2526745d51f2552e3ecd857e3c637e5f621f02677ead805dd8e5
7
- data.tar.gz: 6284babb20532732a56e29dd7155dfcbb7478465fc55851bef6e0a388c74ac286832ca4927ac559b2d1723aa907e1e82979c3091ceb45dd7ed81275e2b969fbb
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
- codebreaker (0.1.0)
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
- codebreaker!
51
+ codebreaker_Bavykin!
52
52
  pry (~> 0.11.3)
53
53
  rake (~> 10.0)
54
54
  rspec (~> 3.0)
@@ -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(difficulty)
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))
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Codebreaker
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end
data/lib/codebreaker.rb CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  require_relative 'codebreaker/version'
4
4
  require 'yaml'
5
- require 'pry'
6
5
  require_relative 'codebreaker/console'
7
6
  require_relative 'codebreaker/storage'
8
7
  require_relative 'codebreaker/game'
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.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-17 00:00:00.000000000 Z
11
+ date: 2017-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler