-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_bot.py
39 lines (27 loc) · 933 Bytes
/
main_bot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from src.game import Tetris
from src.bot import DeepBot, ExpertBot
import random
best_line = 0
best_score = 0
best_seed = 0
tetris = Tetris(take_picture = False,
training_id=3,
display=True,
seed=1132)
#bot = ExpertBot(tetris)
bot = DeepBot(tetris)
while not(tetris.game_over):
# Time of the game
#tetris.tetromino_falls_over_time()
matrix_and_tetromino = tetris.add_tetromino_to_game_board_matrix(tetris.current_tetromino,
tetris.game_board_matrix)
tetris.tetris_window.redraw(matrix_and_tetromino,
tetris.next_tetromino)
#random_bot(tetris)
tetris.user_action()
bot.play()
#print(count_hole_number(tetris.matrix))
#custom_metric(tetris.matrix)
#system_expert(tetris)
print(tetris.tetris_score.score)
print(tetris.tetris_score.lines)