codebreaker_kirill 0.3.1 → 1.0.0
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/Gemfile +2 -0
- data/Gemfile.lock +10 -3
- data/lib/codebreaker_kirill/autoload.rb +1 -0
- data/lib/codebreaker_kirill/stats.rb +18 -1
- data/lib/codebreaker_kirill/user.rb +0 -1
- data/lib/codebreaker_kirill/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03bddb3432e90811fc0b774863524cc77b31d8d6ef333f40294a823558d7f952
|
4
|
+
data.tar.gz: 5e5c9fe328e24f3418ae00f06a1a533f95ce103557f302e291dfbc4782a107fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e70b37a7b95ceca8e465524bda082bb6def70b9292ff7caced08acc62e91449abf52ea97e60101ac100121a01a5c68d505c0a1ac26ca1dda035287bd2405b820
|
7
|
+
data.tar.gz: 1649b7b0235f9a90e860ba341d0db3eb0f6b5fe35a7d98ad9352a49b0e2fb68c246e7b61623bc56408bca7e16d015b10ba0444898b52e1bffd3a17ceac43acb3
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
codebreaker_kirill (0.
|
4
|
+
codebreaker_kirill (0.3.2)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
9
|
ast (2.4.2)
|
10
10
|
diff-lcs (1.5.0)
|
11
|
+
docile (1.1.5)
|
11
12
|
json (2.6.2)
|
12
13
|
parallel (1.22.1)
|
13
14
|
parser (3.1.2.1)
|
@@ -28,7 +29,7 @@ GEM
|
|
28
29
|
diff-lcs (>= 1.2.0, < 2.0)
|
29
30
|
rspec-support (~> 3.11.0)
|
30
31
|
rspec-support (3.11.0)
|
31
|
-
rubocop (1.35.
|
32
|
+
rubocop (1.35.1)
|
32
33
|
json (~> 2.3)
|
33
34
|
parallel (~> 1.10)
|
34
35
|
parser (>= 3.1.2.1)
|
@@ -41,6 +42,11 @@ GEM
|
|
41
42
|
rubocop-ast (1.21.0)
|
42
43
|
parser (>= 3.1.1.0)
|
43
44
|
ruby-progressbar (1.11.0)
|
45
|
+
simplecov (0.12.0)
|
46
|
+
docile (~> 1.1.0)
|
47
|
+
json (>= 1.8, < 3)
|
48
|
+
simplecov-html (~> 0.10.0)
|
49
|
+
simplecov-html (0.10.2)
|
44
50
|
unicode-display_width (2.2.0)
|
45
51
|
|
46
52
|
PLATFORMS
|
@@ -50,6 +56,7 @@ DEPENDENCIES
|
|
50
56
|
codebreaker_kirill!
|
51
57
|
rspec
|
52
58
|
rubocop (~> 1.21)
|
59
|
+
simplecov (~> 0.12.0)
|
53
60
|
|
54
61
|
BUNDLED WITH
|
55
|
-
2.3.
|
62
|
+
2.3.20
|
@@ -1,5 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'yaml'
|
4
|
+
require_relative 'user'
|
5
|
+
|
3
6
|
class Stats
|
4
7
|
def self.save_game(user)
|
5
8
|
@data = File.exist?('stats.yml') ? YAML.load_file('stats.yml') : []
|
@@ -10,6 +13,20 @@ class Stats
|
|
10
13
|
|
11
14
|
def self.show_stats
|
12
15
|
@data = File.exist?('stats.yml') ? YAML.load_file('stats.yml') : []
|
13
|
-
|
16
|
+
@data.sort_by! { |user| [user.attempts[:all], user.attempts[:used], user.hints[:used]] }
|
17
|
+
@data.each_with_index do |user, index|
|
18
|
+
stats_format(user, index)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.stats_format(user, index)
|
23
|
+
index += 1
|
24
|
+
puts "Rating: #{index}", "Name: #{user.name}",
|
25
|
+
"Difficulty: #{Settings::DIFFICULTY.key({ attempts: user.attempts[:all], hints: user.hints[:all] })}",
|
26
|
+
"Available Attempts: #{user.attempts[:all]}",
|
27
|
+
"Used Attempts: #{user.attempts[:used]}",
|
28
|
+
"Available Hints: #{user.hints[:all]}",
|
29
|
+
"Used Hints: #{user.hints[:used]}",
|
30
|
+
'-----------------------'
|
14
31
|
end
|
15
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codebreaker_kirill
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kirill Dudchenko
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|
@@ -55,7 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
version: '0'
|
57
57
|
requirements: []
|
58
|
-
rubygems_version: 3.
|
58
|
+
rubygems_version: 3.3.20
|
59
59
|
signing_key:
|
60
60
|
specification_version: 4
|
61
61
|
summary: Logic game
|