games.go.go_engine
Simple Go engine wrapper using sgfmill instead of sente.
This module provides a compatibility layer to replace sente with sgfmill, which is
compatible with Python 3.12.
Classes
GoGame
|
Simple Go game wrapper using sgfmill. |
sgf
|
SGF compatibility wrapper. |
Functions
Game ([board_size])
|
Create a new Go game. |
dumps_sgf (game)
|
Convert game to SGF string. |
loads_sgf (sgf_string)
|
Load a game from SGF string. |
Module Contents
-
class games.go.go_engine.GoGame(board_size=19)
Simple Go game wrapper using sgfmill.
Init .
- Parameters:
board_size (int) – [TODO: Add description]
-
play_move(color, move)
Play a move on the board.
- Parameters:
color (str) – ‘b’ for black, ‘w’ for white
move (tuple[int, int] | None) – (row, col) tuple or None for pass
-
to_sgf()
Convert game to SGF format.
- Return type:
str
-
turn()
Get current player to move.
- Return type:
str
-
class games.go.go_engine.sgf
SGF compatibility wrapper.
-
static dumps(game)
Save game to SGF.
-
static loads(sgf_string)
Load game from SGF.
- Parameters:
sgf_string (str)
-
games.go.go_engine.Game(board_size=19)
Create a new Go game.
- Parameters:
board_size (int)
- Return type:
GoGame
-
games.go.go_engine.dumps_sgf(game)
Convert game to SGF string.
- Parameters:
game (GoGame)
- Return type:
str
-
games.go.go_engine.loads_sgf(sgf_string)
Load a game from SGF string.
- Parameters:
sgf_string (str)
- Return type:
GoGame