Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
exapunks-hackmatch-bot
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
exapunks-hackmatch-bot
Commits
1ddd7ae4
Commit
1ddd7ae4
authored
Apr 08, 2020
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename parse.py -> detection.py
parent
3683dbca
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
9 deletions
+7
-9
analyze.py
analyze.py
+4
-7
detection.py
detection.py
+0
-0
strategy.py
strategy.py
+3
-2
No files found.
analyze.py
View file @
1ddd7ae4
...
...
@@ -2,9 +2,8 @@
import
os
import
numpy
as
np
from
PIL
import
Image
from
parse
import
BLOCK_SIZE
,
COLUMN_VSHIFT
,
MIN_COLUMN_VAL
,
MIN_COLUMN_SAT
,
\
detect_blocks
,
detect_exa
,
detect_held
,
print_board
,
\
detect_columns
from
detection
import
BLOCK_SIZE
,
COLUMN_VSHIFT
,
MIN_COLUMN_VAL
,
\
MIN_COLUMN_SAT
,
detect_columns
from
strategy
import
State
...
...
@@ -37,10 +36,8 @@ if __name__ == '__main__':
board
=
Image
.
open
(
'screens/board%d.png'
%
ident
).
convert
(
'HSV'
)
#board.crop((0, 0, board.width, detect_columns(board))).show()
blocks
=
list
(
detect_blocks
(
board
))
exa
=
detect_exa
(
board
)
held
=
detect_held
(
board
,
exa
)
print_board
(
blocks
,
exa
,
held
)
state
=
State
.
detect
(
board
)
state
.
print
()
if
extensive
:
make_bitmap
(
board
).
save
(
'screens/bitmap%d.png'
%
ident
)
...
...
parse
.py
→
detection
.py
View file @
1ddd7ae4
File moved
strategy.py
View file @
1ddd7ae4
...
...
@@ -2,8 +2,9 @@ import io
import
time
from
contextlib
import
redirect_stdout
from
itertools
import
combinations
,
islice
from
parse
import
COLUMNS
,
NOBLOCK
,
detect_blocks
,
detect_exa
,
\
detect_held
,
print_board
,
is_basic
,
is_bomb
,
bomb_to_basic
from
detection
import
COLUMNS
,
NOBLOCK
,
detect_blocks
,
detect_exa
,
\
detect_held
,
print_board
,
is_basic
,
is_bomb
,
\
bomb_to_basic
GRAB
,
DROP
,
SWAP
,
LEFT
,
RIGHT
,
SPEED
=
range
(
6
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment