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
47fcb032
Commit
47fcb032
authored
Apr 11, 2020
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip simulated moves that try to move exploding blocks
parent
0bb45a59
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
25 deletions
+34
-25
strategy.py
strategy.py
+34
-25
No files found.
strategy.py
View file @
47fcb032
...
@@ -92,6 +92,15 @@ class State:
...
@@ -92,6 +92,15 @@ class State:
score
+=
row
-
start_row
+
1
score
+=
row
-
start_row
+
1
return
score
return
score
def
locked
(
self
,
i
):
block
=
self
.
blocks
[
i
]
if
block
==
NOBLOCK
:
return
False
if
is_basic
(
block
):
return
self
.
groupsizes
[
i
]
>=
MIN_BASIC_GROUP_SIZE
assert
is_bomb
(
block
)
return
self
.
groupsizes
[
i
]
>=
MIN_BOMB_GROUP_SIZE
def
move
(
self
,
*
moves
):
def
move
(
self
,
*
moves
):
deep
=
any
(
move
in
(
GRAB
,
DROP
,
SWAP
)
for
move
in
moves
)
deep
=
any
(
move
in
(
GRAB
,
DROP
,
SWAP
)
for
move
in
moves
)
s
=
self
.
copy
(
deep
)
s
=
self
.
copy
(
deep
)
...
@@ -112,14 +121,14 @@ class State:
...
@@ -112,14 +121,14 @@ class State:
row
=
s
.
colskip
[
s
.
exa
]
row
=
s
.
colskip
[
s
.
exa
]
assert
row
<
s
.
nrows
assert
row
<
s
.
nrows
i
=
row
*
COLUMNS
+
s
.
exa
i
=
row
*
COLUMNS
+
s
.
exa
if
not
s
.
locked
(
i
):
s
.
held
=
s
.
blocks
[
i
]
s
.
held
=
s
.
blocks
[
i
]
s
.
blocks
[
i
]
=
NOBLOCK
s
.
blocks
[
i
]
=
NOBLOCK
s
.
colskip
[
s
.
exa
]
+=
1
s
.
colskip
[
s
.
exa
]
+=
1
s
.
ungroup
(
i
)
s
.
ungroup
(
i
)
elif
move
==
DROP
:
elif
move
==
DROP
:
assert
not
s
.
colbusy
(
s
.
exa
)
if
s
.
held
!=
NOBLOCK
:
assert
s
.
held
!=
NOBLOCK
row
=
s
.
colskip
[
s
.
exa
]
row
=
s
.
colskip
[
s
.
exa
]
assert
row
>
0
assert
row
>
0
i
=
(
row
-
1
)
*
COLUMNS
+
s
.
exa
i
=
(
row
-
1
)
*
COLUMNS
+
s
.
exa
...
@@ -133,7 +142,7 @@ class State:
...
@@ -133,7 +142,7 @@ class State:
row
=
s
.
colskip
[
s
.
exa
]
row
=
s
.
colskip
[
s
.
exa
]
i
=
row
*
COLUMNS
+
s
.
exa
i
=
row
*
COLUMNS
+
s
.
exa
j
=
i
+
COLUMNS
j
=
i
+
COLUMNS
assert
j
<
len
(
s
.
blocks
)
if
j
<
len
(
s
.
blocks
)
and
not
s
.
locked
(
i
)
and
not
s
.
locked
(
j
):
bi
=
s
.
blocks
[
i
]
bi
=
s
.
blocks
[
i
]
bj
=
s
.
blocks
[
j
]
bj
=
s
.
blocks
[
j
]
if
bi
!=
bj
:
if
bi
!=
bj
:
...
...
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