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
29be6a54
Commit
29be6a54
authored
Apr 09, 2020
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use a fixed delay instead of looking at moves, gives some hickups but seems to work better overall
parent
d37e7b76
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
bot.py
bot.py
+5
-4
strategy.py
strategy.py
+2
-1
No files found.
bot.py
View file @
29be6a54
...
...
@@ -80,10 +80,11 @@ if __name__ == '__main__':
press_keys
(
win
,
solution
.
keys
())
keys_delay
=
len
(
solution
.
moves
)
*
2
*
KEY_DELAY
moves_delay
=
max
(
0
,
solution
.
delay
()
-
keys_delay
)
vprint
(
'wait for'
,
moves_delay
,
'ms'
)
time
.
sleep
(
moves_delay
/
1000
)
#keys_delay = len(solution.moves) * 2 * KEY_DELAY
#moves_delay = max(0, solution.delay() - keys_delay)
#vprint('wait for', moves_delay, 'ms')
#time.sleep(moves_delay / 1000)
time
.
sleep
(
0.070
)
elif
state
.
nrows
()
-
2
<=
MAX_SPEED_ROWS
:
vprint
(
'no moves, speed up'
)
press_keys
(
win
,
'l'
)
...
...
strategy.py
View file @
29be6a54
...
...
@@ -90,7 +90,8 @@ class State:
def
score
(
self
,
points
,
moves
,
prev
):
prev_colsize
=
prev
.
nrows
()
-
2
delay
=
moves_delay
(
moves
)
#delay = moves_delay(moves)
delay
=
len
(
moves
)
# Don't care about defragging for few rows, just score points quickly.
# This saves computation time which in turn makes for nice combos when
...
...
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