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
5fba1b44
Commit
5fba1b44
authored
Apr 05, 2020
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Smarter way of looking at empty columns
parent
d1321855
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
strategy.py
strategy.py
+15
-2
No files found.
strategy.py
View file @
5fba1b44
...
...
@@ -54,16 +54,29 @@ class State:
for
col
in
range
(
COLUMNS
):
yield
self
.
nrows
()
-
self
.
colskip
(
col
)
def
hole_score
(
self
):
score
=
0
for
col
in
range
(
COLUMNS
):
for
row
in
range
(
self
.
nrows
()):
i
=
row
*
COLUMNS
+
col
if
self
.
blocks
[
i
]
!=
NOBLOCK
:
break
score
+=
row
+
1
return
score
def
score
(
self
,
points
,
moves
,
prev
):
frag
=
self
.
fragmentation
()
colsizes
=
list
(
self
.
colsizes
())
mincol
=
min
(
colsizes
)
#
mincol = min(colsizes)
maxcol
=
max
(
colsizes
)
colsize_score
=
maxcol
,
colsizes
.
count
(
maxcol
),
-
mincol
colsize_score
=
maxcol
,
colsizes
.
count
(
maxcol
)
#
, -mincol
#colsize_score = tuple(sorted(colsizes, reverse=True))
#if prev.nrows() >= 6:
# return colsize_score, -points, frag, len(moves)
colsize_score
=
maxcol
,
self
.
hole_score
()
prev_colsize
=
max
(
prev
.
colsizes
())
if
prev_colsize
>=
COLSIZE_PRIO
:
...
...
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