Play it yourself¶
Take a seat in any world and play against a model, a scripted opponent or another agent, in the terminal or in the browser. It is the quickest way to learn a world, to test a world you are writing, and to feel how strong a model really is.
The rules are in SPEC-027.
Tic-tac-toe in the terminal¶
agentplaykit play --human
This plays the built-in demo with you as o against scripted/minimax, a perfect player. Each
empty cell shows the number to type:
demo: tic-tac-toe, you play o against a perfect player (scripted/minimax)
tic-tac-toe: you are o.
Tic-tac-toe on a 3x3 board. Cells are numbered 0-8, ...
type a move, ? to list the legal moves, rules, > text to send a message, or resign
0 | 1 | 2
3 | 4 | 5
6 | 7 | x
legal moves: 0 1 2 3 4 5 6 7
your move (o): 4
When the game is over you see the final board and the result. A perfect player cannot be beaten: a draw is the best you can do.
Take a seat in any scenario¶
--human replaces one agent of a scenario with you, keeping its id:
agentplaykit play my-scenario.yaml --human black
Without an id you play the first agent. A scenario can also seat you itself:
agents:
- {id: white, use: human, config: {name: tejas}}
- {id: black, use: scripted/chess, config: {level: 1}}
name (default you) is how reports list you: human:tejas.
Chess in the browser¶
agentplaykit play examples/chess/vs-level-1.yaml --human white --live
With --live you play in the run page. On your turn it shows Your move: click a piece and
then its square, or pick a move from the buttons. When a pawn promotes, it asks which piece. In
worlds whose moves are cell numbers, such as tic-tac-toe, click a cell. The page also has a
message box, sent with your next move, and a Resign button.
scripted/chess has three levels; see Chess for
how strong each one is. Set level: 2 or 3 in the example when level 1 is too easy.
In the terminal the same game draws the board in letters, your side at the bottom:
8 r n b q k b n r
7 p p p p . p p p
6 . . . . p . . .
5 . . . . . . . .
4 . . . . P . . .
3 . . . . . . . .
2 P P P P . P P P
1 R N B Q K B N R
a b c d e f g h
legal moves: Nc3 Na3 Qe2 Qf3 Qg4 Qh5 Ke2 Be2 Bd3 Bc4 Bb5 Ba6 Nh3 Ne2 Nf3 a3 ...
your move (white): Nf3
What you see, and what you do not¶
You get exactly what a model gets in your seat: - the world's rules, once at the start; - your observation (the board, drawn when the world declares one, otherwise as JSON); - your legal moves; - messages sent to you or to everyone, and notes such as a dropped message; - why your last move was rejected, if it was.
You never see another agent's observation, its reasoning or a private message between others while the game plays. In the browser the live server does not even send them to the page, so they cannot be read in the browser's developer tools. When the game is over, the page shows the whole replay, reasoning included.
Terminal commands¶
| Type | What it does |
|---|---|
| a move | plays it: 4, e4, Nf3, or a sentence such as I play e4 |
? |
lists all legal moves (when there are more than 40) |
rules |
prints the rules again |
> text |
sends a message to everyone with your next move |
>@id text |
sends a message to one agent |
resign |
gives up: you lose by forfeit |
| Ctrl+C | stops the run |
A move that is not legal is refused right away, with the legal moves, and you type again. It is never sent to the world, so it does not count as an illegal move.
Good to know¶
- A game with a person has no time limit, unless the scenario sets
limits.max_seconds. --runs 3plays three games in a row, each with the next seed.- The log records you like any agent (
kind: human), soview,reportand the evaluators work on your games: the strategy evaluator rates your moves too. - Experiments, benchmark runs, tournaments and
model checkrefuse a human player (human.not_here): they play many games and measure agents, not people. - Without a terminal (input from a pipe or a script), use
--live(human.no_terminal).