codebracker_simb 0.9.2 → 0.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/lib/codebracker_simb/game.rb +0 -20
- data/lib/codebracker_simb/version.rb +1 -1
- data/lib/codebracker_simb.rb +5 -5
- data/lib/{codebracker_simb/errors → errors}/code_error.rb +0 -0
- data/lib/{codebracker_simb/errors → errors}/complexity_error.rb +0 -0
- data/lib/{codebracker_simb/errors → errors}/intro_error.rb +0 -0
- data/lib/{codebracker_simb/errors → errors}/name_error.rb +0 -0
- data/lib/{codebracker_simb/errors → errors}/no_hints_error.rb +0 -0
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3356bb3020b49ba5a2c23e81b1b37b5773b75f7e3c3acf21e6cd03723f6f631
|
4
|
+
data.tar.gz: f26790bfc8279ed403c9dc9cd90cc3bab95fde60650baa2991ac08d7ce3371cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d83b7aa808c6df1eb0dfb99f38884900306dc089de22a083699e1ed916e62e80b47c6f0a3428f9165e0e3fe68074e047c5ccf4c346e60265a9027bccbeb2012b
|
7
|
+
data.tar.gz: 5f29919e84d4f5675a65da7f1484938b0262ff586462092966650013a5d7385f42620b13f8c6e9b77571f95a3ef437cbbb0d0c0ac89b1e615a23e6ab802b3ed7
|
@@ -11,20 +11,6 @@ module CodebrackerSimb
|
|
11
11
|
attr_reader :code, :attempts, :player, :complexity
|
12
12
|
attr_accessor :answer, :hint_positions, :hints
|
13
13
|
|
14
|
-
IS_OVER = 'Game is over, you lose'
|
15
|
-
GREETING = 'Hello! Welcome to CodeBracker Game! Have fun!'
|
16
|
-
CONGRATULATIONS = 'Congratulations! You broked a code, master!'
|
17
|
-
|
18
|
-
class << self
|
19
|
-
def scores
|
20
|
-
db.execute 'select * from scores order by attempts_total asc, attempts_used asc, hints_used asc'
|
21
|
-
end
|
22
|
-
|
23
|
-
def db
|
24
|
-
SQLite3::Database.new 'score.db'
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
14
|
def initialize(complexity, player)
|
29
15
|
@attempts = game_options(complexity)[:attempts]
|
30
16
|
@hints = game_options(complexity)[:hints]
|
@@ -72,12 +58,6 @@ module CodebrackerSimb
|
|
72
58
|
end
|
73
59
|
end
|
74
60
|
|
75
|
-
def write_to_db
|
76
|
-
db = Game.db
|
77
|
-
db.execute 'insert into scores (name, difficulty, attempts_total, attempts_used, hints_total, hints_used) values (?,?,?,?,?,?)',
|
78
|
-
params
|
79
|
-
end
|
80
|
-
|
81
61
|
def params
|
82
62
|
total_attempts = game_options(complexity)[:attempts]
|
83
63
|
total_hints = game_options(complexity)[:hints]
|
data/lib/codebracker_simb.rb
CHANGED
@@ -3,11 +3,11 @@
|
|
3
3
|
require_relative 'codebracker_simb/version'
|
4
4
|
require_relative 'codebracker_simb/game'
|
5
5
|
require_relative 'codebracker_simb/validator'
|
6
|
-
require_relative '
|
7
|
-
require_relative '
|
8
|
-
require_relative '
|
9
|
-
require_relative '
|
10
|
-
require_relative '
|
6
|
+
require_relative 'errors/no_hints_error'
|
7
|
+
require_relative 'errors/code_error'
|
8
|
+
require_relative 'errors/name_error'
|
9
|
+
require_relative 'errors/complexity_error'
|
10
|
+
require_relative 'errors/intro_error'
|
11
11
|
require_relative 'codebracker_simb/text'
|
12
12
|
|
13
13
|
# gem module
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codebracker_simb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- max
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-09-
|
11
|
+
date: 2022-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -91,15 +91,15 @@ files:
|
|
91
91
|
- codebracker_simb.gemspec
|
92
92
|
- lib/codebracker_simb.rb
|
93
93
|
- lib/codebracker_simb/checker.rb
|
94
|
-
- lib/codebracker_simb/errors/code_error.rb
|
95
|
-
- lib/codebracker_simb/errors/complexity_error.rb
|
96
|
-
- lib/codebracker_simb/errors/intro_error.rb
|
97
|
-
- lib/codebracker_simb/errors/name_error.rb
|
98
|
-
- lib/codebracker_simb/errors/no_hints_error.rb
|
99
94
|
- lib/codebracker_simb/game.rb
|
100
95
|
- lib/codebracker_simb/text.rb
|
101
96
|
- lib/codebracker_simb/validator.rb
|
102
97
|
- lib/codebracker_simb/version.rb
|
98
|
+
- lib/errors/code_error.rb
|
99
|
+
- lib/errors/complexity_error.rb
|
100
|
+
- lib/errors/intro_error.rb
|
101
|
+
- lib/errors/name_error.rb
|
102
|
+
- lib/errors/no_hints_error.rb
|
103
103
|
homepage:
|
104
104
|
licenses:
|
105
105
|
- MIT
|