# Tabletwin > Tabletwin models board and card games as YAML: the rules as data. On tabletwin.com the engine plays > a model in the browser, the validator (https://tabletwin.com/validate/) checks it, and the diagram > shows its rules. The engine itself is not distributed: check models with the validator page. > To write a model from a rulebook, read the quick reference, the guide and the reference, start > from an example, and validate until there are no errors and the model is executable. Everything is plain Markdown or YAML. [llms-full.txt](https://tabletwin.com/llms-full.txt) has all pages in one file (quick reference and reference first). If your tool cannot read a long file at once, read the pages below one by one; long pages are also available per section. ## Docs - [Overview](https://tabletwin.com/docs/index.md): What a Tabletwin model is and where to find what. - [Guide: from rulebook to model](https://tabletwin.com/docs/guide.md): Step by step from a rulebook to a validated, executable model. - [Guide: from rulebook to model: introduction](https://tabletwin.com/docs/guide/00-guide-from-rulebook-to-model-introductio.md) - [What you build](https://tabletwin.com/docs/guide/01-what-you-build.md) - [Tutorial: Pig from rulebook to executable model](https://tabletwin.com/docs/guide/02-tutorial-pig-from-rulebook-to-executable.md) - [The workflow for any game](https://tabletwin.com/docs/guide/03-the-workflow-for-any-game.md) - [Decision rules](https://tabletwin.com/docs/guide/04-decision-rules.md) - [Patterns](https://tabletwin.com/docs/guide/05-patterns.md) - [Pitfalls](https://tabletwin.com/docs/guide/06-pitfalls.md) - [Checking a model](https://tabletwin.com/docs/guide/07-checking-a-model.md) - [Checklist before you call a model done](https://tabletwin.com/docs/guide/08-checklist-before-you-call-a-model-done.md) - [Authoring with an AI agent](https://tabletwin.com/docs/authoring-with-ai.md): The workflow and prompt for letting an AI agent write a model from a rulebook. - [Quick reference](https://tabletwin.com/docs/cheatsheet.md): Everything on one page: keys, ops, flow, end conditions, names in scope, patterns. - [Quick reference: introduction](https://tabletwin.com/docs/cheatsheet/00-quick-reference-introduction.md) - [Top-level keys](https://tabletwin.com/docs/cheatsheet/01-top-level-keys.md) - [State](https://tabletwin.com/docs/cheatsheet/02-state.md) - [Flow nodes](https://tabletwin.com/docs/cheatsheet/03-flow-nodes.md) - [Actions and ops](https://tabletwin.com/docs/cheatsheet/04-actions-and-ops.md) - [Windows, triggers, content, outcomes, agents](https://tabletwin.com/docs/cheatsheet/05-windows-triggers-content-outcomes-agents.md) - [End conditions](https://tabletwin.com/docs/cheatsheet/06-end-conditions.md) - [Names in scope](https://tabletwin.com/docs/cheatsheet/07-names-in-scope.md) - [Places and option labels](https://tabletwin.com/docs/cheatsheet/08-places-and-option-labels.md) - [Checking your model](https://tabletwin.com/docs/cheatsheet/09-checking-your-model.md) - [Patterns](https://tabletwin.com/docs/cheatsheet/10-patterns.md) - [Model reference](https://tabletwin.com/docs/reference.md): Every key of a model file: state, actions, ops, flow, windows, triggers, content, end conditions. - [Model reference: introduction](https://tabletwin.com/docs/reference/00-model-reference-introduction.md) - [1. Conventions](https://tabletwin.com/docs/reference/01-1-conventions.md) - [2. Top-level keys](https://tabletwin.com/docs/reference/02-2-top-level-keys.md) - [3. `constants`](https://tabletwin.com/docs/reference/03-3-constants.md) - [4. `boards`](https://tabletwin.com/docs/reference/04-4-boards.md) - [5. `functions`](https://tabletwin.com/docs/reference/05-5-functions.md) - [6. `state`](https://tabletwin.com/docs/reference/06-6-state.md) - [7. Instances](https://tabletwin.com/docs/reference/07-7-instances.md) - [8. Stack order](https://tabletwin.com/docs/reference/08-8-stack-order.md) - [9. `flow` and `flows`](https://tabletwin.com/docs/reference/09-9-flow-and-flows.md) - [10. `actions`](https://tabletwin.com/docs/reference/10-10-actions.md) - [11. Ops](https://tabletwin.com/docs/reference/11-11-ops.md) - [12. Places, options and events](https://tabletwin.com/docs/reference/12-12-places-options-and-events.md) - [13. Priority windows](https://tabletwin.com/docs/reference/13-13-priority-windows.md) - [14. `triggers`](https://tabletwin.com/docs/reference/14-14-triggers.md) - [15. Modifiers](https://tabletwin.com/docs/reference/15-15-modifiers.md) - [16. `content`](https://tabletwin.com/docs/reference/16-16-content.md) - [17. `outcomes`](https://tabletwin.com/docs/reference/17-17-outcomes.md) - [18. `agents`](https://tabletwin.com/docs/reference/18-18-agents.md) - [19. `end`](https://tabletwin.com/docs/reference/19-19-end.md) - [20. Validator](https://tabletwin.com/docs/reference/20-20-validator.md) - [21. `code`](https://tabletwin.com/docs/reference/21-21-code.md) - [22. `open_questions`](https://tabletwin.com/docs/reference/22-22-open_questions.md) - [23. Limits](https://tabletwin.com/docs/reference/23-23-limits.md) - [24. Tools on the site](https://tabletwin.com/docs/reference/24-24-tools-on-the-site.md) - [Expression language](https://tabletwin.com/docs/expressions.md): The expression language in `_x` fields: syntax, built-in functions, names in scope. - [Board geometry](https://tabletwin.com/docs/board-geometry.md): Square and hex boards, and the geometry functions. - [Tactics](https://tabletwin.com/docs/tactics.md): Players as a separate layer: rules per decision place. - [Views](https://tabletwin.com/docs/views.md): How the table looks in the player: view files. - [How the engine runs a model](https://tabletwin.com/docs/engine.md): Requests, chance, hidden information, windows, end conditions, executability. - [How the engine runs a model: introduction](https://tabletwin.com/docs/engine/00-how-the-engine-runs-a-model-introduction.md) - [Requests](https://tabletwin.com/docs/engine/01-requests.md) - [Start of a game](https://tabletwin.com/docs/engine/02-start-of-a-game.md) - [Running the flow](https://tabletwin.com/docs/engine/03-running-the-flow.md) - [Effects and ops](https://tabletwin.com/docs/engine/04-effects-and-ops.md) - [End conditions](https://tabletwin.com/docs/engine/05-end-conditions.md) - [Engine events](https://tabletwin.com/docs/engine/06-engine-events.md) - [Information: who sees what](https://tabletwin.com/docs/engine/07-information-who-sees-what.md) - [Executability](https://tabletwin.com/docs/engine/08-executability.md) - [Checking and running a model on the site](https://tabletwin.com/docs/engine/09-checking-and-running-a-model-on-the-site.md) - [Error messages](https://tabletwin.com/docs/engine/10-error-messages.md) - [Limits](https://tabletwin.com/docs/engine/11-limits.md) - [The diagram](https://tabletwin.com/docs/diagram.md): How the rules diagram is drawn from a model. ## Schemas - [Model JSON schema](https://tabletwin.com/models/docs/schema.json) - [Commented metamodel](https://tabletwin.com/models/metamodel.yaml) ## Example models - [chess](https://tabletwin.com/models/games/chess.yaml) - [kuhn-poker](https://tabletwin.com/models/games/kuhn-poker.yaml) - [eightball](https://tabletwin.com/models/games/eightball.yaml) - [tictactoe](https://tabletwin.com/models/games/tictactoe.yaml) - [hex-skirmish](https://tabletwin.com/models/docs/examples/hex-skirmish.yaml) (small example) - [pig](https://tabletwin.com/models/docs/examples/pig.yaml) (small example) - [higher-lower](https://tabletwin.com/models/docs/examples/higher-lower.yaml) (small example) - [ambush](https://tabletwin.com/models/docs/examples/ambush.yaml) (small example) - [auction](https://tabletwin.com/models/docs/examples/auction.yaml) (small example) - [neighbours](https://tabletwin.com/models/docs/examples/neighbours.yaml) (small example) - [expedition](https://tabletwin.com/models/docs/examples/expedition.yaml) (small example) ## Optional - [tactics/chess-material.yaml](https://tabletwin.com/models/tactics/chess-material.yaml) - [tactics/hex-skirmish-basic.yaml](https://tabletwin.com/models/tactics/hex-skirmish-basic.yaml) - [views/chess.yaml](https://tabletwin.com/models/views/chess.yaml) - [views/hex-skirmish.yaml](https://tabletwin.com/models/views/hex-skirmish.yaml) - [views/tictactoe.yaml](https://tabletwin.com/models/views/tictactoe.yaml)