cshogi.web package
Submodules
cshogi.web.app module
- class cshogi.web.app.Human(human_input)[source]
Bases:
object
- cshogi.web.app.colab(engine1=None, engine2=None, options1={}, options2={}, name1=None, name2=None, byoyomi=None, time=None, inc=None, draw=256, csa=None)[source]
- cshogi.web.app.match(moves, engine1=None, engine2=None, options1={}, options2={}, names=None, byoyomi=None, time=None, inc=None, draw=256, human_input=None, csa=None)[source]
- cshogi.web.app.run(engine1=None, engine2=None, options1={}, options2={}, name1=None, name2=None, byoyomi=None, time=None, inc=None, draw=256, csa=None, host='localhost', port=8000)[source]
Initializes and runs a shogi match between two engines or replays a game from a given CSA file. The match or replay is rendered using Flask and is accessible via a web interface.
- Parameters:
engine1 (str | None) – Name or path of the first engine, or ‘human’ for human player. Default is None.
engine2 (str | None) – Name or path of the second engine, or ‘human’ for human player. Default is None.
options1 (Dict) – Configuration options for the first engine. Default is an empty dictionary.
options2 (Dict) – Configuration options for the second engine. Default is an empty dictionary.
name1 (str | None) – Optional name for the first player. Default is None.
name2 (str | None) – Optional name for the second player. Default is None.
byoyomi (int | None) – Byoyomi time in milliseconds. Default is None.
time (int | None) – Time control for the match in milliseconds. Default is None.
inc (int | None) – Increment time for each move in milliseconds. Default is None.
draw (int) – Number of moves before a draw is claimed. Default is 256.
csa (str | None) – Path to a CSA file to replay a game. Default is None.
host (str) – Hostname to bind the Flask server to. Default is ‘localhost’.
port (int) – Port number to bind the Flask server to. Default is 8000.