Make pep8 happier

This commit is contained in:
Yorick Barbanneau 2023-12-22 13:37:50 +01:00
parent c9774498e0
commit fe185631b3
2 changed files with 12 additions and 12 deletions

View file

@ -1,5 +1,6 @@
import logging import logging
class CustomFormatter(logging.Formatter): class CustomFormatter(logging.Formatter):
grey = "\x1b[0;35m" grey = "\x1b[0;35m"

View file

@ -50,7 +50,7 @@ def parse_aguments():
parser.add_argument('-bh', parser.add_argument('-bh',
'--black-heuristic-engine', '--black-heuristic-engine',
help='Black player heutistic engine', help='Black player heutistic engine',
choices= heuristic_choices, choices=heuristic_choices,
default='score', default='score',
) )
@ -93,7 +93,7 @@ def parse_aguments():
help='Weight table for weight based heuristic engines', help='Weight table for weight based heuristic engines',
type=int, type=int,
nargs=4, nargs=4,
default=[-5, 2, 10,25] default=[-5, 2, 10, 25]
) )
parser.add_argument('-r', parser.add_argument('-r',
@ -202,7 +202,7 @@ if __name__ == '__main__':
white_time = 0 white_time = 0
black_time = 0 black_time = 0
while recursions > 0: while recursions > 0:
while ( not game.is_game_over()): while (not game.is_game_over()):
start_time = time.time() start_time = time.time()
if game._nextPlayer == 1: if game._nextPlayer == 1:
move = bplayer.get_move(game) move = bplayer.get_move(game)
@ -231,7 +231,7 @@ if __name__ == '__main__':
print("\nGAME OVER\n---\nWINNER: {} | black:{} in {:>5}s | white:{} in {:>5}s".format( print("\nGAME OVER\n---\nWINNER: {} | black:{} in {:>5}s | white:{} in {:>5}s".format(
winner, winner,
game._nbBLACK, game._nbBLACK,
format(black_time,'4.3f'), format(black_time, '4.3f'),
game._nbWHITE, game._nbWHITE,
format(white_time, '4.3f') format(white_time, '4.3f')
)) ))
@ -266,7 +266,7 @@ if __name__ == '__main__':
print("White: {:>2} | ratio: {:>6} | time: {:>8}s | engine: {}".format( print("White: {:>2} | ratio: {:>6} | time: {:>8}s | engine: {}".format(
white, white,
white * 100 / numbers, white * 100 / numbers,
format(total_time_white,'4.3f'), format(total_time_white, '4.3f'),
wplayer._get_class_name(), wplayer._get_class_name(),
)) ))
@ -277,4 +277,3 @@ if __name__ == '__main__':
print("---\nBlack player options: {}\nWhite player options: {}".format( print("---\nBlack player options: {}\nWhite player options: {}".format(
bplayer.options, wplayer.options bplayer.options, wplayer.options
)) ))