fsmosca / combat Goto Github PK
View Code? Open in Web Editor NEWA python script to run engine vs engine game matches.
License: GNU General Public License v3.0
A python script to run engine vs engine game matches.
License: GNU General Public License v3.0
Hi Fsmosca,
Thank you for this useful Tournament Manager
I hope you are doing very well.
Friendly Request, Could you please add Gauntlet Tournament with option 1 engine always plays white or black (without players swapping sides)
Hello, when using Combat, I figured that the same openings are picked given a opening PGN file.
In function get_game_list, the current code stops adding games from the opening file once it has reached the max_round value and only then the random shuffling takes place :
if file_suffix == '.pgn':
with open(fn) as pgn:
while True:
game = chess.pgn.read_game(pgn)
if game is None:
break
games.append(game)
if len(games) >= max_round:
break
else:
with open(fn) as pos:
for lines in pos:
line = lines.strip()
board = chess.Board(line)
game = chess.pgn.Game()
game = game.from_board(board)
games.append(game)
if len(games) >= max_round:
break
I've modified it such that the opening file is opened entirely, then the shuffling takes place, and only then the first max_round games are kept:
_if file_suffix == '.pgn':
with open(fn) as pgn:
while True:
game = chess.pgn.read_game(pgn)
if game is None:
break
games.append(game)
else:
with open(fn) as pos:
for lines in pos:
line = lines.strip()
board = chess.Board(line)
game = chess.pgn.Game()
game = game.from_board(board)
games.append(game)
if randomize_pos:
random.shuffle(games)
elapse = time.perf_counter()*1000000000 - t1
if len(games) < max_round:
logger.info('Number of positions in the file {} are below max_round {}!'.format(len(games),max_round ))
logger.info('status: done, games prepared: {}, elapse: {}\n'.format(len(games), get_time_h_mm_ss_ms(elapse)))
logger.info('maxround: {}, len games maxround: {}\n'.format(max_round, len(games[:max_round])))
return games[:max_round]_
Hope this will help improve the Combat script.
For setting engines, options and others, so that user does not have to edit the source code.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.