From d66c32903e325a6f57781d75bca0481eb113c99c Mon Sep 17 00:00:00 2001 From: Austin Date: Mon, 14 Apr 2025 18:40:22 -0700 Subject: [PATCH] add go_13x13. tests not implemented. --- README.md | 2 +- docs/go.md | 2 +- pgx/_src/visualizer.py | 2 +- pgx/core.py | 7 ++++++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2f76742f7..908b602e6 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ Use `pgx.available_envs() -> Tuple[EnvId]` to see the list of currently availabl |Chess
`"chess"` || `v2` | *Checkmate opponent's king to win.* | |Connect Four
`"connect_four"` || `v0` | *Connect discs, win with four.* | |Gardner Chess
`"gardner_chess"`|| `v0` | *5x5 chess variant, excluding castling.* | -|Go
`"go_9x9"` `"go_19x19"` || `v1` | *Strategically place stones, claim territory.* | +|Go
`"go_9x9"` `"go_13x13"` `"go_19x19"` || `v1` | *Strategically place stones, claim territory.* | |Hex
`"hex"` || `v0` | *Connect opposite sides, block opponent.* | |Kuhn Poker
`"kuhn_poker"` || `v1` | *Three-card betting and bluffing game.* | |Leduc hold'em
`"leduc_holdem"` || `v0` | *Two-suit, limited deck poker.* | diff --git a/docs/go.md b/docs/go.md index 77a8432de..07221ee3a 100644 --- a/docs/go.md +++ b/docs/go.md @@ -18,7 +18,7 @@ ```py import pgx -env = pgx.make("go_19x19") # or "go_9x9" +env = pgx.make("go_19x19") # or "go_9x9" , "go_13x13" ``` or you can directly load `Go` class diff --git a/pgx/_src/visualizer.py b/pgx/_src/visualizer.py index 17e2f3b0f..e2ebe172f 100644 --- a/pgx/_src/visualizer.py +++ b/pgx/_src/visualizer.py @@ -356,7 +356,7 @@ def _set_config_by_state(self, _state: State): # noqa: C901 "black", "gray", ) - elif _state.env_id in ("go_9x9", "go_19x19"): + elif _state.env_id in ("go_9x9", "go_13x13", "go_19x19"): from pgx._src.dwg.go import _make_go_dwg self.config["GRID_SIZE"] = 25 diff --git a/pgx/core.py b/pgx/core.py index 027c451c1..6873317a9 100644 --- a/pgx/core.py +++ b/pgx/core.py @@ -47,6 +47,7 @@ "connect_four", "gardner_chess", "go_9x9", + "go_13x13", "go_19x19", "hex", "kuhn_poker", @@ -303,7 +304,7 @@ def available_envs() -> Tuple[EnvId, ...]: ```py pgx.available_envs() - ('2048', 'animal_shogi', 'backgammon', 'chess', 'connect_four', 'go_9x9', 'go_19x19', 'hex', 'kuhn_poker', 'leduc_holdem', 'minatar-asterix', 'minatar-breakout', 'minatar-freeway', 'minatar-seaquest', 'minatar-space_invaders', 'othello', 'shogi', 'sparrow_mahjong', 'tic_tac_toe') + ('2048', 'animal_shogi', 'backgammon', 'chess', 'connect_four', 'go_9x9',' go_13x13', 'go_19x19', 'hex', 'kuhn_poker', 'leduc_holdem', 'minatar-asterix', 'minatar-breakout', 'minatar-freeway', 'minatar-seaquest', 'minatar-space_invaders', 'othello', 'shogi', 'sparrow_mahjong', 'tic_tac_toe') ``` @@ -365,6 +366,10 @@ def make(env_id: EnvId): # noqa: C901 from pgx.go import Go return Go(size=9, komi=7.5) + elif env_id == "go_13x13": + from pgx.go import Go + + return Go(size=13, komi=7.5) elif env_id == "go_19x19": from pgx.go import Go