Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds HEX0N as a Python game,
python_hex0n.HEX0N is a two-player abstract placement game on an N×N board (5×5 by default). Players place squares, circles and triangles. A triangle that touches a circle and a square removes all three, and the same player then places a permanent, scoring hex on one of the cleared cells. Squares are a limited supply. When a triangle touches several eligible circle+square pairs, one is removed at random, which is modelled as an explicit chance node with up to 16 equally likely outcomes. Most hexes wins, with an optional tie-break on the largest connected hex group.
It is a placement game with stochastic outcomes and a depletable resource, which makes it a compact testbed for placement+conversion+chance.
Polished version & Benchmarks: https://github.com/yiotri/hextriad
Game type
SEQUENTIAL,EXPLICIT_STOCHASTIC,PERFECT_INFORMATION,ZERO_SUM,TERMINALrewards.sizetie_breakopponent_piecesActions are
kind * N² + cell(square, circle, triangle, hex) plus one pass action, legal only when no placement is.Changes
open_spiel/python/games/hex0n.py: the game.open_spiel/python/games/hex0n_test.py: 15 tests. They cover random simulation with serialization on 4×4, 5×5 (all variants) and 7×7, a triad with and without a chance node, the 16-outcome maximum, pass legality, tie-break returns, etc.open_spiel/integration_tests/playthroughs/python_hex0n.txt, generated withgenerate_new_playthrough.sh.games/__init__.py,python/CMakeLists.txt,tests/pyspiel_test.py, plus a row indocs/games.md.Verification
hex0n_test.py: 15/15 pass.api_test.pyandplaythrough_test.pypass forpython_hex0n.