Skip to main content

hundredandten-automation-engineadapter

Bridge between the Hundred and Ten game engine and automation strategies.

This is the only package that depends on both hundredandten-engine and hundredandten-state. It translates engine Game objects into player-agnostic GameState observations that strategies can act on, and converts strategy-layer AvailableAction results back into engine Action objects.

Usage

The most common usage is action_for, which handles the full loop: build state, call a strategy, validate the result, return an engine action.

from hundredandten.automation.engineadapter import EngineAdapter
from hundredandten.automation import naive
from hundredandten.engine import Game, Player

game = Game(players=[Player('player_1'), Player('player_2')])
engine_action = EngineAdapter.action_for(game, 'player_2', naive.action_for)
game.act(engine_action)

Exports

EngineAdapter

All methods are static.

Method Signature Description
action_for (game, identifier, decision_fn) -> Action Full-loop helper. Builds a GameState for the identified player, calls decision_fn(state), validates that the result is a legal action, and returns the corresponding engine Action. Raises UnavailableActionError if the decision function returns an illegal action.
state_from_engine (game, identifier) -> GameState Builds a player-agnostic GameState observation for the identified player. All seats are rotated so the requesting player is seat 0. Cards the player cannot see are marked Unknown.
available_action_for_player (action, identifier) -> Action Converts a player-agnostic AvailableAction into a player-aware engine Action by attaching the player identifier.
available_action_from_engine (action) -> AvailableAction Converts a player-aware engine Action into a player-agnostic AvailableAction.

UnavailableActionError

Raised by action_for when the decision function returns an action not present in state.available_actions.

Building state without a strategy

from hundredandten.automation.engineadapter import EngineAdapter

state = EngineAdapter.state_from_engine(game, 'player_1')
print(state.available_actions)

Metadata

Release files for hundredandten-automation-engineadapter 0.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for hundredandten-automation-engineadapter 0.0.9
File Interpreter ABI Platform
hundredandten_automation_engineadapter-0.0.9-py3-none-any.whl Python 3 none any Details

Release files / hundredandten_automation_engineadapter-0.0.9-py3-none-any.whl

Download URL hundredandten_automation_engineadapter-0.0.9-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b807e45f2a36fd47d728200dc41615f1412359ff3c5b6e6dd0b07a225903c6a
BLAKE2b-256 checksum
How to use checksums
c1222224f2ded629311ba63e25d0f84eef6af9bb2ac85af85cd28be2a603953a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.0.11

1 release file

0.0.10

1 release file

This release

0.0.9 This release

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page