software_challenge_client 22.1.0.1 → 23.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +15 -15
- data/.rspec +3 -3
- data/.rubocop.yml +11 -11
- data/.ruby-version +1 -1
- data/.stickler.yml +7 -7
- data/.vscode/launch.json +40 -40
- data/.vscode/settings.json +9 -9
- data/AUTHORS +6 -6
- data/CODE_OF_CONDUCT.md +13 -13
- data/Dockerfile +3 -3
- data/Gemfile +5 -5
- data/Guardfile +45 -45
- data/README.md +172 -147
- data/RELEASES.md +144 -140
- data/Rakefile +7 -7
- data/bin/console +15 -15
- data/bin/setup +7 -7
- data/develop.sh +3 -3
- data/example/client.rb +35 -35
- data/example/main.rb +42 -42
- data/example/start.bat +2 -2
- data/generate-authors.sh +19 -19
- data/lib/software_challenge_client/board.rb +149 -127
- data/lib/software_challenge_client/client_interface.rb +19 -19
- data/lib/software_challenge_client/condition.rb +27 -27
- data/lib/software_challenge_client/coordinates.rb +71 -45
- data/lib/software_challenge_client/debug_hint.rb +17 -17
- data/lib/software_challenge_client/direction.rb +41 -0
- data/lib/software_challenge_client/field.rb +70 -69
- data/lib/software_challenge_client/game_rule_logic.rb +206 -141
- data/lib/software_challenge_client/game_state.rb +57 -24
- data/lib/software_challenge_client/invalid_move_exception.rb +15 -15
- data/lib/software_challenge_client/logging.rb +26 -26
- data/lib/software_challenge_client/move.rb +37 -41
- data/lib/software_challenge_client/network.rb +126 -126
- data/lib/software_challenge_client/piece.rb +43 -81
- data/lib/software_challenge_client/player.rb +31 -31
- data/lib/software_challenge_client/protocol.rb +103 -54
- data/lib/software_challenge_client/runner.rb +36 -36
- data/lib/software_challenge_client/team.rb +23 -25
- data/lib/software_challenge_client/util/constants.rb +9 -9
- data/lib/software_challenge_client/version.rb +5 -5
- data/lib/software_challenge_client.rb +23 -25
- data/lib/update_client_module.sh +15 -15
- data/push_image_production.sh +12 -12
- data/release.sh +9 -9
- data/software_challenge_client.gemspec +41 -41
- metadata +3 -5
- data/lib/software_challenge_client/color.rb +0 -26
- data/lib/software_challenge_client/has_hints.rb +0 -11
- data/lib/software_challenge_client/piece_type.rb +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60bece75249bc3382f19429df53fe59d38cd3c0336c4cb58982ad7babdc81523
|
4
|
+
data.tar.gz: 3232b375adf7d834cd13cd8fdec9a55727db2e6f709c3915da3370c783445535
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6147a792d581f94f583b7c0e387cae1fa81b1a7bdea9b23ab8cd5e5a199dbacda6e54bacf9b25111e8ab06b2b4433e2f1255a9c576b8591499af4d9f885d4a53
|
7
|
+
data.tar.gz: 0cffbefe16a7cf32c7af914b2175ae0fd2c563313c28846013317f2cd7a7ca4082541bf352c75a96515f9ca48f433f36a1f2bbf9ceb5838a6b0673ae2e31b8cf
|
data/.gitignore
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
/.bundle/
|
2
|
-
/.yardoc
|
3
|
-
/Gemfile.lock
|
4
|
-
/_yardoc/
|
5
|
-
/coverage/
|
6
|
-
/doc/
|
7
|
-
/pkg/
|
8
|
-
/spec/reports/
|
9
|
-
/tmp/
|
10
|
-
/bin/
|
11
|
-
/vendor
|
12
|
-
/spec/examples.txt
|
13
|
-
/test/
|
14
|
-
*.gem
|
15
|
-
test/client.rb
|
1
|
+
/.bundle/
|
2
|
+
/.yardoc
|
3
|
+
/Gemfile.lock
|
4
|
+
/_yardoc/
|
5
|
+
/coverage/
|
6
|
+
/doc/
|
7
|
+
/pkg/
|
8
|
+
/spec/reports/
|
9
|
+
/tmp/
|
10
|
+
/bin/
|
11
|
+
/vendor
|
12
|
+
/spec/examples.txt
|
13
|
+
/test/
|
14
|
+
*.gem
|
15
|
+
test/client.rb
|
data/.rspec
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
--color
|
2
|
-
--require spec_helper
|
3
|
-
--format Fuubar
|
1
|
+
--color
|
2
|
+
--require spec_helper
|
3
|
+
--format Fuubar
|
data/.rubocop.yml
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
AllCops:
|
2
|
-
NewCops: enable
|
3
|
-
TargetRubyVersion: 2.4
|
4
|
-
DefaultFormatter: fuubar
|
5
|
-
DisplayStyleGuide: true
|
6
|
-
DisplayCopNames: false
|
7
|
-
#require: rubocop-rspec
|
8
|
-
Style/AsciiComments:
|
9
|
-
Enabled: false # we use german comments to document relevant methods for the pupils
|
10
|
-
Metrics/BlockLength:
|
11
|
-
ExcludedMethods: ['describe', 'context'] # RSpec uses a DSL where large blocks are okay, see https://stackoverflow.com/questions/40934345/rubocop-25-line-block-size-and-rspec-tests
|
1
|
+
AllCops:
|
2
|
+
NewCops: enable
|
3
|
+
TargetRubyVersion: 2.4
|
4
|
+
DefaultFormatter: fuubar
|
5
|
+
DisplayStyleGuide: true
|
6
|
+
DisplayCopNames: false
|
7
|
+
#require: rubocop-rspec
|
8
|
+
Style/AsciiComments:
|
9
|
+
Enabled: false # we use german comments to document relevant methods for the pupils
|
10
|
+
Metrics/BlockLength:
|
11
|
+
ExcludedMethods: ['describe', 'context'] # RSpec uses a DSL where large blocks are okay, see https://stackoverflow.com/questions/40934345/rubocop-25-line-block-size-and-rspec-tests
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.5.5
|
1
|
+
2.5.5
|
data/.stickler.yml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
linters:
|
2
|
-
rubocop:
|
3
|
-
fixer: true
|
4
|
-
shellcheck:
|
5
|
-
shell: bash
|
6
|
-
fixers:
|
7
|
-
enable: true
|
1
|
+
linters:
|
2
|
+
rubocop:
|
3
|
+
fixer: true
|
4
|
+
shellcheck:
|
5
|
+
shell: bash
|
6
|
+
fixers:
|
7
|
+
enable: true
|
data/.vscode/launch.json
CHANGED
@@ -1,41 +1,41 @@
|
|
1
|
-
{
|
2
|
-
// Use IntelliSense to learn about possible attributes.
|
3
|
-
// Hover to view descriptions of existing attributes.
|
4
|
-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
5
|
-
"version": "0.2.0",
|
6
|
-
"configurations": [
|
7
|
-
{
|
8
|
-
"name": "Ruby - Main",
|
9
|
-
"type": "Ruby",
|
10
|
-
"request": "launch",
|
11
|
-
"program": "test/main.rb"
|
12
|
-
},
|
13
|
-
{
|
14
|
-
"name": "Ruby - Gem Main",
|
15
|
-
"type": "Ruby",
|
16
|
-
"request": "launch",
|
17
|
-
"program": "example/main.rb"
|
18
|
-
},
|
19
|
-
{
|
20
|
-
"name": "RSpec - Active spec File only",
|
21
|
-
"type": "Ruby",
|
22
|
-
"request": "launch",
|
23
|
-
"program": "C:/tools/ruby27/bin/rspec",
|
24
|
-
"args": [
|
25
|
-
"-I",
|
26
|
-
"${workspaceRoot}",
|
27
|
-
"${file}"
|
28
|
-
]
|
29
|
-
},
|
30
|
-
{
|
31
|
-
"name": "RSpec - All",
|
32
|
-
"type": "Ruby",
|
33
|
-
"request": "launch",
|
34
|
-
"program": "C:/tools/ruby27/bin/rspec",
|
35
|
-
"args": [
|
36
|
-
"-I",
|
37
|
-
"${workspaceRoot}"
|
38
|
-
]
|
39
|
-
},
|
40
|
-
]
|
1
|
+
{
|
2
|
+
// Use IntelliSense to learn about possible attributes.
|
3
|
+
// Hover to view descriptions of existing attributes.
|
4
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
5
|
+
"version": "0.2.0",
|
6
|
+
"configurations": [
|
7
|
+
{
|
8
|
+
"name": "Ruby - Main",
|
9
|
+
"type": "Ruby",
|
10
|
+
"request": "launch",
|
11
|
+
"program": "test/main.rb"
|
12
|
+
},
|
13
|
+
{
|
14
|
+
"name": "Ruby - Gem Main",
|
15
|
+
"type": "Ruby",
|
16
|
+
"request": "launch",
|
17
|
+
"program": "example/main.rb"
|
18
|
+
},
|
19
|
+
{
|
20
|
+
"name": "RSpec - Active spec File only",
|
21
|
+
"type": "Ruby",
|
22
|
+
"request": "launch",
|
23
|
+
"program": "C:/tools/ruby27/bin/rspec",
|
24
|
+
"args": [
|
25
|
+
"-I",
|
26
|
+
"${workspaceRoot}",
|
27
|
+
"${file}"
|
28
|
+
]
|
29
|
+
},
|
30
|
+
{
|
31
|
+
"name": "RSpec - All",
|
32
|
+
"type": "Ruby",
|
33
|
+
"request": "launch",
|
34
|
+
"program": "C:/tools/ruby27/bin/rspec",
|
35
|
+
"args": [
|
36
|
+
"-I",
|
37
|
+
"${workspaceRoot}"
|
38
|
+
]
|
39
|
+
},
|
40
|
+
]
|
41
41
|
}
|
data/.vscode/settings.json
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
{
|
2
|
-
"spellright.language": [
|
3
|
-
"de"
|
4
|
-
],
|
5
|
-
"spellright.documentTypes": [
|
6
|
-
"markdown",
|
7
|
-
"latex",
|
8
|
-
"plaintext"
|
9
|
-
]
|
1
|
+
{
|
2
|
+
"spellright.language": [
|
3
|
+
"de"
|
4
|
+
],
|
5
|
+
"spellright.documentTypes": [
|
6
|
+
"markdown",
|
7
|
+
"latex",
|
8
|
+
"plaintext"
|
9
|
+
]
|
10
10
|
}
|
data/AUTHORS
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
# This file lists all individuals having contributed content to the repository.
|
2
|
-
# For how it is generated, see `generate-authors.sh`.
|
3
|
-
|
4
|
-
kwollw <kwollw@users.noreply.github.com>
|
5
|
-
Ralf-Tobias Diekert <ralfbias@hotmail.com>
|
6
|
-
Sven Koschnicke <s.koschnicke@gfxpro.com>
|
1
|
+
# This file lists all individuals having contributed content to the repository.
|
2
|
+
# For how it is generated, see `generate-authors.sh`.
|
3
|
+
|
4
|
+
kwollw <kwollw@users.noreply.github.com>
|
5
|
+
Ralf-Tobias Diekert <ralfbias@hotmail.com>
|
6
|
+
Sven Koschnicke <s.koschnicke@gfxpro.com>
|
data/CODE_OF_CONDUCT.md
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
# Contributor Code of Conduct
|
2
|
-
|
3
|
-
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
-
|
5
|
-
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
|
6
|
-
|
7
|
-
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
-
|
9
|
-
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
-
|
11
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
-
|
13
|
-
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
+
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
|
6
|
+
|
7
|
+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
+
|
9
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
+
|
11
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
+
|
13
|
+
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/Dockerfile
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
FROM ruby:2.
|
2
|
-
|
3
|
-
RUN gem install --no-document software_challenge_client
|
1
|
+
FROM ruby:2.7.5
|
2
|
+
|
3
|
+
RUN gem install --no-document software_challenge_client
|
data/Gemfile
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
source 'https://rubygems.org'
|
3
|
-
|
4
|
-
# Specify your gem's dependencies in SoftwareChallengeClient.gemspec
|
5
|
-
gemspec
|
1
|
+
# frozen_string_literal: true
|
2
|
+
source 'https://rubygems.org'
|
3
|
+
|
4
|
+
# Specify your gem's dependencies in SoftwareChallengeClient.gemspec
|
5
|
+
gemspec
|
data/Guardfile
CHANGED
@@ -1,45 +1,45 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
# frozen_string_literal: true
|
3
|
-
# A sample Guardfile
|
4
|
-
# More info at https://github.com/guard/guard#readme
|
5
|
-
|
6
|
-
## Uncomment and set this to only include directories you want to watch
|
7
|
-
directories %w(lib lib/software_challenge_client spec)
|
8
|
-
# the following seems to cause problems in certain ruby versions:
|
9
|
-
# directories %w(lib lib/software_challenge_client spec).select do |d|
|
10
|
-
# Dir.exist?(d) ? d : UI.warning("Directory #{d} does not exist")
|
11
|
-
# end
|
12
|
-
|
13
|
-
## Note: if you are using the `directories` clause above and you are not
|
14
|
-
## watching the project directory ('.'), then you will want to move
|
15
|
-
## the Guardfile to a watched dir and symlink it back, e.g.
|
16
|
-
#
|
17
|
-
# $ mkdir config
|
18
|
-
# $ mv Guardfile config/
|
19
|
-
# $ ln -s config/Guardfile .
|
20
|
-
#
|
21
|
-
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"
|
22
|
-
|
23
|
-
# This group allows to skip running RuboCop when RSpec failed.
|
24
|
-
group :red_green_refactor, halt_on_fail: true do
|
25
|
-
guard :rspec, cmd: 'rspec', all_after_pass: true, all_on_start: true do
|
26
|
-
watch(%r{^lib/software_challenge_client/(.+)\.rb$}) do |match|
|
27
|
-
spec_file = "spec/#{match[1]}_spec.rb"
|
28
|
-
if File.exist?(spec_file)
|
29
|
-
spec_file # run spec belonging to the file which was changed
|
30
|
-
else
|
31
|
-
'spec' # run all specs
|
32
|
-
end
|
33
|
-
end
|
34
|
-
watch(%r{^spec/.+_spec\.rb$}) # no block means the matched file is returned
|
35
|
-
|
36
|
-
watch('lib/software_challenge_client.rb') { 'spec' }
|
37
|
-
watch('spec/spec_helper.rb') { 'spec' }
|
38
|
-
end
|
39
|
-
|
40
|
-
# guard :rubocop, all_on_start: false do
|
41
|
-
# # This never includes external ruby files because of the
|
42
|
-
# # directory constraint at the top of this file:
|
43
|
-
# watch(/.*.rb/)
|
44
|
-
# end
|
45
|
-
end
|
1
|
+
# encoding: UTF-8
|
2
|
+
# frozen_string_literal: true
|
3
|
+
# A sample Guardfile
|
4
|
+
# More info at https://github.com/guard/guard#readme
|
5
|
+
|
6
|
+
## Uncomment and set this to only include directories you want to watch
|
7
|
+
directories %w(lib lib/software_challenge_client spec)
|
8
|
+
# the following seems to cause problems in certain ruby versions:
|
9
|
+
# directories %w(lib lib/software_challenge_client spec).select do |d|
|
10
|
+
# Dir.exist?(d) ? d : UI.warning("Directory #{d} does not exist")
|
11
|
+
# end
|
12
|
+
|
13
|
+
## Note: if you are using the `directories` clause above and you are not
|
14
|
+
## watching the project directory ('.'), then you will want to move
|
15
|
+
## the Guardfile to a watched dir and symlink it back, e.g.
|
16
|
+
#
|
17
|
+
# $ mkdir config
|
18
|
+
# $ mv Guardfile config/
|
19
|
+
# $ ln -s config/Guardfile .
|
20
|
+
#
|
21
|
+
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"
|
22
|
+
|
23
|
+
# This group allows to skip running RuboCop when RSpec failed.
|
24
|
+
group :red_green_refactor, halt_on_fail: true do
|
25
|
+
guard :rspec, cmd: 'rspec', all_after_pass: true, all_on_start: true do
|
26
|
+
watch(%r{^lib/software_challenge_client/(.+)\.rb$}) do |match|
|
27
|
+
spec_file = "spec/#{match[1]}_spec.rb"
|
28
|
+
if File.exist?(spec_file)
|
29
|
+
spec_file # run spec belonging to the file which was changed
|
30
|
+
else
|
31
|
+
'spec' # run all specs
|
32
|
+
end
|
33
|
+
end
|
34
|
+
watch(%r{^spec/.+_spec\.rb$}) # no block means the matched file is returned
|
35
|
+
|
36
|
+
watch('lib/software_challenge_client.rb') { 'spec' }
|
37
|
+
watch('spec/spec_helper.rb') { 'spec' }
|
38
|
+
end
|
39
|
+
|
40
|
+
# guard :rubocop, all_on_start: false do
|
41
|
+
# # This never includes external ruby files because of the
|
42
|
+
# # directory constraint at the top of this file:
|
43
|
+
# watch(/.*.rb/)
|
44
|
+
# end
|
45
|
+
end
|