Rework statistics, add score
This commit is contained in:
parent
da7f83735b
commit
f22edf8084
1 changed files with 10 additions and 4 deletions
14
src/game.py
14
src/game.py
|
@ -246,6 +246,8 @@ if __name__ == '__main__':
|
||||||
white = 0
|
white = 0
|
||||||
total_time_black = 0
|
total_time_black = 0
|
||||||
total_time_white = 0
|
total_time_white = 0
|
||||||
|
total_score_black = 0
|
||||||
|
total_score_white = 0
|
||||||
null = 0
|
null = 0
|
||||||
for g in games:
|
for g in games:
|
||||||
black += 1 if g[1] > g[3] else 0
|
black += 1 if g[1] > g[3] else 0
|
||||||
|
@ -253,20 +255,24 @@ if __name__ == '__main__':
|
||||||
null += 1 if g[1] == g[3] else 0
|
null += 1 if g[1] == g[3] else 0
|
||||||
total_time_black += g[2]
|
total_time_black += g[2]
|
||||||
total_time_white += g[4]
|
total_time_white += g[4]
|
||||||
|
total_score_black += g[1]
|
||||||
|
total_score_white += g[3]
|
||||||
|
|
||||||
print("Stats\n---")
|
print("Stats\n---")
|
||||||
print("Games: {} in {:>6}s".format(numbers, total_time_white + total_time_black))
|
print("Games: {} in {:>6}s".format(numbers, total_time_white + total_time_black))
|
||||||
print("Black: {:>2} | ratio: {:>6} | time: {:>8}s | engine: {}".format(
|
print("Black: {:>2} | ratio: {:>6} | time: {:>8}s | score: {:.>9} | engine: {}".format(
|
||||||
black,
|
black,
|
||||||
black * 100 / numbers,
|
format(black * 100 / numbers, '3.2f'),
|
||||||
format(total_time_black, '4.3f'),
|
format(total_time_black, '4.3f'),
|
||||||
|
total_score_black,
|
||||||
bplayer._get_class_name(),
|
bplayer._get_class_name(),
|
||||||
))
|
))
|
||||||
|
|
||||||
print("White: {:>2} | ratio: {:>6} | time: {:>8}s | engine: {}".format(
|
print("White: {:>2} | ratio: {:>6} | time: {:>8}s | score: {:.>9} | engine: {}".format(
|
||||||
white,
|
white,
|
||||||
white * 100 / numbers,
|
format(white * 100 / numbers, '3.2f'),
|
||||||
format(total_time_white, '4.3f'),
|
format(total_time_white, '4.3f'),
|
||||||
|
total_score_white,
|
||||||
wplayer._get_class_name(),
|
wplayer._get_class_name(),
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue