pyplAI
v0.1.0Play board games against MCTS, minimax and ISMCTS, and use the same searches as tools.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_games
List the games you can play, their move format and the algorithms available for each.
get_rules
Full rules and move notation of a game, in Markdown. The same text as the rules://{game} resource.
| Parameter | Type | Description |
|---|---|---|
game * | string | Game name from list_games. |
new_game
Start a game against a pyplAI algorithm. If the opponent moves first, it has already moved in the returned state.
| Parameter | Type | Description |
|---|---|---|
game * | string | Game to play. See list_games. |
minimax_depth | integer | Search depth (moves ahead) for the minimax opponent. |
opening | Moves to play from the start, for both players, before the game is handed over. Use it to set up a position. | |
opponent | string | Opponent algorithm. auto picks the strongest fair one for the game. |
opponent_seconds | number | Thinking time per move for Monte Carlo opponents. |
play_as | integer | Your player number. Player 1 moves first. |
seed | Seed for the opponent's search, to make its play reproducible. |
get_state
Show the board as you see it, your legal moves and what has happened so far.
| Parameter | Type | Description |
|---|---|---|
game_id * | string | Id returned by new_game. |
play_move
Play a move. The opponent replies straight away, so the returned state is your next turn (or the end of the game).
| Parameter | Type | Description |
|---|---|---|
game_id * | string | Id returned by new_game. |
move * | string | One of the legal moves, as written in legal_moves. |
analyze_position
Rank your legal moves with a search from the current position. It only uses information you have.
| Parameter | Type | Description |
|---|---|---|
game_id * | string | Id returned by new_game. |
algorithm | string | Search to run. auto uses MCTS for perfect-information games and MO-ISMCTS for Phantom. |
minimax_depth | integer | Depth (moves ahead) for minimax. |
seconds | number | Search time for Monte Carlo algorithms. |
top_k | integer | How many of the best moves to return. |
end_game
Forget a game you no longer need.
| Parameter | Type | Description |
|---|---|---|
game_id * | string | Id returned by new_game. |