Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
exapunks-hackmatch-bot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Taddeüs Kroes
exapunks-hackmatch-bot
Commits
087df026
Commit
087df026
authored
5 years ago
by
Taddeüs Kroes
Browse files
Options
Downloads
Patches
Plain Diff
Minors
parent
fe38baf2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
analyze.py
+4
-5
4 additions, 5 deletions
analyze.py
strategy.py
+2
-1
2 additions, 1 deletion
strategy.py
with
6 additions
and
6 deletions
analyze.py
+
4
−
5
View file @
087df026
...
...
@@ -2,9 +2,9 @@
import
os
import
numpy
as
np
from
PIL
import
Image
from
parse
r
import
BLOCK_SIZE
,
COLUMN_VSHIFT
,
MIN_COLUMN_VAL
,
MIN_COLUMN_SAT
,
\
detect_blocks
,
detect_exa
,
detect_held
,
print_board
,
\
detect_columns
from
parse
import
BLOCK_SIZE
,
COLUMN_VSHIFT
,
MIN_COLUMN_VAL
,
MIN_COLUMN_SAT
,
\
detect_blocks
,
detect_exa
,
detect_held
,
print_board
,
\
detect_columns
from
strategy
import
State
...
...
@@ -33,11 +33,10 @@ def make_bitmap(board):
if
__name__
==
'
__main__
'
:
import
sys
ident
=
int
(
sys
.
argv
[
1
])
extensive
=
sys
.
argv
[
2
]
==
'
y
'
if
len
(
sys
.
argv
)
>
2
else
False
extensive
=
len
(
sys
.
argv
)
>
2
and
sys
.
argv
[
2
]
==
'
y
'
board
=
Image
.
open
(
'
screens/board%d.png
'
%
ident
).
convert
(
'
HSV
'
)
#board.crop((0, 0, board.width, detect_columns(board))).show()
state
=
State
.
detect
(
board
)
blocks
=
list
(
detect_blocks
(
board
))
exa
=
detect_exa
(
board
)
held
=
detect_held
(
board
,
exa
)
...
...
This diff is collapsed.
Click to expand it.
strategy.py
+
2
−
1
View file @
087df026
...
...
@@ -24,7 +24,6 @@ MAX_SPEED_ROWS = 3
class
State
:
def
__init__
(
self
,
blocks
,
exa
,
held
):
assert
exa
is
not
None
self
.
blocks
=
blocks
self
.
exa
=
exa
self
.
held
=
held
...
...
@@ -295,6 +294,8 @@ class State:
yield
mov1
+
get
+
mov2
+
put
def
solve
(
self
):
assert
self
.
exa
is
not
None
if
self
.
held
!=
NOBLOCK
:
return
(
DROP
,)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment