# Getting started
Table Tarot holds [b]random tables[/b] for tabletop games. Each table is a card on the felt. Cards are joined by copper [b]threads[/b], so one roll can lead on to the next: a travel roll finds a stranger, and the stranger gets a name.

## Two modes
- [b]Play[/b] is for the game table. Click a die to roll, and read the result in the tray at the bottom.
- [b]Build[/b] is for making and changing tables. Click a card, a result or a thread to edit it in the inspector on the right.

Switch between them with [b]Play | Build[/b] at the top left. Everything you build is saved as you go.

## Try the sample
The Fantasy Loot spread shows most features:
- [b]Wilderness Travel[/b] is a d100 table whose results thread into other tables.
- [b]Party Roles[/b] deals each role once until the deck is reshuffled ([topic]Deck mode[/topic]).
- [b]Make Camp[/b] asks you to pick what the party does ([topic]Choice cards[/topic]).
- [b]Search the Ruins[/b] adds your [b]Luck[/b] to the roll, and two of its results can only be reached with good or bad luck ([topic]Roll modifiers[/topic]).

# Rolling
Click the die button on a card to roll it. The results flicker, one lands and lights up in brass, and the roll follows any threads from that result to other cards.
- [b]Shift-click[/b] the die to skip the animation.
- Hover a result to read its details. A small ⓘ after a card's name means the card has details too.
- On a ranged card, the percentage beside each result is its chance right now.

Some cards stop and ask you something before the roll goes on. See [topic]Choice cards[/topic].

# The result tray
The tray at the bottom of the window shows the last roll as a row of steps, one per card the roll passed through.
- [b]Why this?[/b] on a step explains it in plain words: what was rolled, any modifier, and why the roll went where it did.
- [b]Roll again[/b] repeats the last roll.
- [b]Copy ▾[/b] copies the result as plain text, as BBCode for forums, or with the details of each step.
- [b]Earlier[/b] lists your recent rolls. [b]Variables[/b] lists the values the spread remembers between rolls, such as Luck.

Drag the tray's top edge to make it taller or shorter. Double-click the edge to reset it.

# Building tables
Switch to [b]Build[/b] to edit.
- [b]+ Card ▾[/b] adds a new roll table or one of the logic cards.
- Type straight into a card's name and results. [b]+ Add result[/b] adds a row at the bottom.
- The [b]×1[/b] beside a result is its weight. A weight of 3 makes that result three times as likely as a weight of 1.
- Hover a row to show its [b]×[/b] delete button.
- The card's [b]⋯[/b] menu has Table settings, Save as template, Collapse and Delete table.
- Click a card's title, a result's text or a thread to edit it in the [b]inspector[/b] on the right. Drag the inspector's left edge to resize it.

Every edit can be undone with [b]Ctrl+Z[/b] or the ↶ button, and redone with [b]Ctrl+Shift+Z[/b], [b]Ctrl+Y[/b] or ↷.

## Table settings
[b]Table settings…[/b] in the ⋯ menu sets the card's type, dice, details and tags, and turns on [topic]Deck mode[/topic].

# Ranged tables and dice
A [b]ranged table[/b] gives each result a range of numbers instead of a weight, the way printed tables do: 01–30 Travelers on the road, 31–50 Beasts on the hunt, and so on.
- Set the dice in Table settings: `1d100`, `2d6`, `d20` or any expression.
- In Build mode each row has a from and a to box for its range.
- [b]Weather[/b] in the sample rolls `2d6`, so the middle results come up most often. The card shows each chance.

Dice can be written `2d6`, `d20`, `3D` or `D3`. A missing count means 1 and missing sides mean 6, so `2D` is 2d6. To add a value to the dice, use a [topic]Roll modifiers[/topic] modifier.

# Threads
A thread carries the roll from a result to another card.
- In Build mode, drag from the ● at the right of a result onto another card to lay a thread.
- When that result is rolled, the card at the other end is rolled too. The threads of a roll light up in brass.
- Click a thread on the felt to edit it in the inspector.

## Thread options
- [b]Count[/b] rolls the next card more than once. It can be a number or an expression such as `1d3`.
- [b]Save as[/b] keeps the next card's result under a name, so later text can show it as `{name}`.
- [b]Only if[/b] runs the thread only when a condition is true, such as `@gold >= 10`.
- [b]Otherwise[/b] runs the thread only when none of the result's Only if threads ran.
- [b]Inputs[/b] pass values to a card that declares them.

## Rolling with other dice
A thread can roll a card with numbered ranges using different dice, just this once.
- Type the dice in [b]Roll it with … instead[/b], such as `3d10+70`. Leave it empty to use the card's own dice.
- Example: a World Feature card is rolled with 1d100, but "Multiple features" rolls it twice with 3d10+70, so only the higher results come up.

## Rolling again on some results
A thread can roll its card again when certain results come up.
- Open [b]Roll again if it comes up[/b] and tick those results.
- Example: "Mixed" rolls World Feature twice, rolling again on any 96 or higher, so it never lands on itself.

[demo]threads[/demo]

# Roll modifiers
A ranged table can add a [b]modifier[/b] to its dice, for rules like "roll 1d20 and add your Luck".
- In Build mode, select the card and set the modifier in the inspector: [b]Add[/b] a value, [b]Subtract[/b] one, or write your own.
- [b]Ranges can go past the dice.[/b] A 1d6 table can have results for 0 or less and for 7 and up. Only a modifier reaches them, and their number's tooltip says so.
- Totals past either end count as the end result, so the top result also catches every higher total.
- The chances on the card follow the modifier's value as it is now.

## In the sample
[b]Search the Ruins[/b] rolls 1d6 + Luck. With no Luck you can't reach "A tunnel caves in" or "A hidden vault". Pray at the shrine in [b]Make Camp[/b] to raise your Luck, gamble with the guards to lower it, then search again and watch the chances move. Why this? on the step names the modifier: "+1 for Luck".

Deck mode decks ignore the modifier.

# Deck mode
[b]Deck mode[/b] turns a table into a deck of cards. Each result is dealt once, with no repeats, until the deck runs out.
- Turn it on in the inspector (Build mode: click the card's name) under [b]Deck mode → Draw without repeats[/b].
- The card shows how many are left, for example [b]4 / 6 left[/b], and results already drawn are faded.
- [b]↻ Shuffle[/b] under the card's name puts every card back. [b]Shuffle all decks[/b] (right-click the spread, or ☰) does every deck at once.
- [b]When the deck is empty[/b] it can shuffle by itself, or wait for you to shuffle. While it waits, rolling it gives its [b]Empty result[/b] (“Empty” unless you write something else) and the roll goes no further.

[b]Party Roles[/b] in the sample is a deck: hand one role to each player, and nobody gets the same role twice until you shuffle.

[demo]deck[/demo]

# Choice cards
A choice card stops the roll and asks the player. Add one from [b]+ Card ▾[/b].
- [b]Which option[/b] lists the card's options to pick from. [b]Random[/b] is always offered too. The picked option runs exactly as if it had been rolled: its changes happen and its threads follow.
- [b]How many[/b] asks for a number between a lowest and highest value.
- [b]Open ended[/b] asks for any text.

The question can show values, such as "Your Luck is {@luck}. What now?". Answers can be saved under a name for later. [b]Cancel[/b] in the pop-up stops the whole roll, and the pop-up can be minimized to look at the spread first.

## Options that come and go
An option can have [b]Show only if[/b], so it's offered only when a condition is true, such as `@gold >= 10`. A Which option card can also build its options from a collection of values, such as every skill the character has.

[b]Make Camp[/b] in the sample is a Which option card.

# Values and changes
A spread can remember [b]values[/b] between rolls, such as Luck, Gold or the current town. In rules a value is written with @: `@luck`.
- Any result can have [b]changes[/b] that happen when it comes up: [b]Add 1 to Luck[/b], [b]Subtract 3 from Gold[/b], [b]Set Town to …[/b]. Edit them in the inspector as rows, or with Edit as text.
- A [b]Variable[/b] card gives a value a name, a type and a starting value, and shows what it is now. The sample's [b]Luck[/b] card starts at 0.
- A [b]Collection[/b] card groups related values, such as Skills, so they can be listed and picked from together.
- The tray's [b]Variables[/b] tab shows every value, and lets you clear or reset them. [b]Reset all…[/b] puts every value back to its start.

## Writing changes as text
- `@luck += 1` adds, `@luck -= 1` subtracts and `@gold = 2d6` sets.
- `reset @luck` goes back to the starting value. `reset @skill_*` resets every value starting with skill_.
- Text values work as lists: `@traits += "Brave"` adds an item.

## Conditions
Conditions are used by Only if threads, branches, repeats and Show only if. In plain words they read "Luck is at least 2". As text: `@luck >= 2`, `@town = "Saltmere"`, `@gold > 0 and @luck < 3`.

# Logic cards
Besides roll tables and choices, [b]+ Card ▾[/b] adds:
- [b]Check card[/b]: rolls dice plus a modifier against a target, such as 2d6 + Skill against 8, and follows its Success or Failure result.
- [b]Repeat[/b]: repeats its Each time result a number of times, or while or until a condition holds, then runs Afterwards once.
- [b]Branch[/b]: checks its cases from top to bottom (if, else if, otherwise) and follows the first one that's true.
- [b]Sheet[/b]: a page of text, such as a character sheet, that always shows the current values. A roll that reaches it prints it in the tray.
- [b]Variable[/b] and [b]Collection[/b]: see [topic]Values and changes[/topic].

Use [b]Test spread[/b] to check that a spread of logic cards works. See [topic]Testing a spread[/topic].

# Text in results
Result text can do more than plain words:
- `[[Traveler Names]]` rolls that table and puts its result in the text.
- `[[Traveler Names -> patron]]` also saves it as patron, so later text can say `{patron}`.
- `{@town}` shows a value. `{@town|Towns}` shows it, or rolls Towns once and remembers the answer if it isn't set yet.
- `{= @gold * 2}` shows a worked-out number.
- Formatting: `[b]bold[/b]` and `[i]italic[/i]`.

[b]Quest Hooks[/b] in the sample uses all of these.

# Groups and templates
## Groups
- Drag a box on empty space to select several cards and groups (hold Ctrl or Shift to add to the selection), or Ctrl-click or Shift-click cards. Dragging any selected card or group moves them all.
- Press [b]Ctrl+G[/b] to put them in a group: a frame that moves and collapses as one.
- Drag cards into or out of a group. The group's ⋯ menu renames, saves as a template, ungroups or deletes it.
- [b]Spread ▾ → Pack collapsed groups[/b] moves collapsed groups together to close the gaps.

## Templates
A template is a saved card, group or selection that you can insert again, with blanks to fill in.
- Save one from a card's ⋯ menu, a group's ⋯ menu, or the selection bar.
- Insert one from [b]+ Card ▾ → From template…[/b].
- Built-in templates include a skill check, ask-and-repeat, a pick menu, a counter and a simple sheet.

# Menus: right-click and ☰
Right-click almost anything for what you can do with it. On a phone or tablet, press and hold instead.
- [b]A card[/b]: roll it, roll it several times, shuffle its deck, collapse it, and in Build its settings, colour, template and delete.
- [b]A thread[/b]: go to either end, and in Build edit it, colour it or delete it.
- [b]A group[/b]: expand or collapse it, and in Build its details, template, ungroup or delete.
- [b]Empty space[/b]: a new card right there, group the selection, search, shuffle all decks, fit the spread, List view, the Book and the theme.
The [b]☰[/b] button in the top bar has the same things as right-clicking empty space.

# Selecting, moving and resizing
- Drag a box on empty space to select cards and groups. Hold [b]Ctrl[/b] or [b]Shift[/b] to add to the selection.
- Drag any selected card or group and everything selected moves together.
- Drag the small lines in a card's bottom-right corner to make it wider or taller; a taller card's results scroll inside it. Double-click the corner to go back to its own size.
- Cards can go anywhere: there's no edge to the spread.
- Zoomed far out, cards just show their names when you hover. You can still drag them and right-click them, and in Play a click rolls them.

# Groups inside groups
Groups can hold other groups. Select a group (drag a box around it) along with any cards, and press [b]Ctrl+G[/b]: the new group holds them all. Closing the outer group hides everything inside it. [b]Ungroup[/b] hands the contents to the group around it.
[demo]groups[/demo]

# Colours and themes
- [b]View ▾ → Theme…[/b] picks a theme and lets you change its colours, the background and panel gradients, the background pattern, the card border and the logo. Changes to a built-in theme are saved as a theme of your own.
- Give a card or a thread its own colour from its right-click menu ([b]Colour[/b]) or in the inspector, to sort things at a glance.

# List view
[b]List view[/b] (View ▾, ☰ or right-click the spread) shows every card as a plain list, for when you'd rather not use the spread.
- Folders are groups. [b]+ Folder[/b] makes one; drag cards onto a folder, or a folder onto another.
- Drag cards up and down to put them in your own order.
- [b]←2 →3[/b] counts the threads coming in and going out; hover to see where they lead.
- Click [b]Roll[/b] to roll a card. Double-click a card to find it on the spread.
- The list has its own search box.

# The Book
The [b]Book[/b] holds [b]Pages[/b]: results you want to use on more than one table, with their formatting, details, tags and picture.
- Open it from View ▾, ☰ or right-click the spread. [b]+ Page[/b] adds one; in Build, a result's inspector has [b]Save to the Book[/b].
- Drag a page onto a result to use it there, or onto a card to add it as a new result. Results using a page show a small §.
- Edit a page and every result using it changes. Change a result's own text and it stops following the page ([b]Unlink[/b] does the same).
[demo]book[/demo]

# Rolling more than once
- A thread can roll its card several times ([b]Rolls 3 times[/b] in the thread's inspector). Then choose what happens: [b]Keep every roll[/b], [b]Add them together[/b], [b]Keep the highest[/b], [b]Keep the lowest[/b] or [b]Let me choose[/b]. Rolls that aren't kept are faded in the tray, and don't follow their own threads.
- [b]Roll several times…[/b] on a card's menu rolls its whole chain as many times as you like (five villagers, ten treasures) and shows every result together, ready to copy.
[demo]repeats[/demo]

# Pausing a roll
Tick [b]Wait for me first[/b] on a thread and the roll stops there, with [b]Continue ▸[/b] and [b]Stop here[/b] in the tray. Use it to reveal something a piece at a time. If you roll something else meanwhile, the paused roll waits in the tray until you continue it.
[demo]pause[/demo]

# Options that cost
An option on a [b]Which option[/b] card can cost something: in its inspector, [b]Costs [1] of [Points][/b]. Picking it takes that away; when there isn't enough, the option is greyed out and says why. An option such as [b]Reroll[/b] that threads back to the loot card and costs a point gives players a spend-a-point reroll.
[demo]costs[/demo]

# One table adjusting another
A ranged card can have limits: [b]Never below[/b] and [b]Never above[/b], each a number or a value. An earlier result can set that value with a change, so it adjusts a later roll. For example "Thick haze" sets [b]Atmo min[/b] to 7, and Atmosphere is set to never go below Atmo min. To push a later roll up or down instead, give it a [topic]Roll modifiers[/topic] value that the earlier result sets. [b]Why this?[/b] says when a limit moved a roll.
[demo]limits[/demo]

# Sheets and saving results
A [b]Sheet[/b] card shows values as a finished page, such as a character. In its inspector, [b]+ Add a line for[/b] a value adds a "Name: value" line for you.
To keep a result outside the app, use the tray's [b]Copy ▾ → Save as a file[/b]: plain text, Markdown, or a web page you can open in a browser and print as a PDF. A roll that reached a sheet saves the sheet.
[demo]sheet[/demo]

# Pictures
A result or a Book page can have a picture: [b]Picture → Choose…[/b] in its inspector or page. It shows as a small picture on the card and a bigger one when you hover. Pictures are kept inside the spread, so exports and imports bring them along.

# On a phone or tablet
- The list fills the screen; [b]Spread[/b] and [b]List[/b] swap between them.
- Press and hold for the right-click menu. Two fingers move and zoom the spread.
- View, Help and Play/Build are in the [b]☰[/b] menu.

# Spreads, import and export
A [b]spread[/b] is one layout of cards, saved under its own name. Use the switcher beside Play | Build (it shows the spread's name) to switch, or to make a new spread, rename, duplicate or delete one.

In Build mode, [b]Spread ▾[/b] has:
- [b]Import as new spread…[/b] for Table Tarot JSON, JSON Canvas and GraphML files.
- [b]Export as…[/b] Table Tarot JSON, JSON Canvas, GraphML, a Mermaid diagram or Graphviz DOT.

Exports hold the tables only. Your roll history, decks and remembered values stay on this computer.

# Testing a spread
[b]Spread ▾ → Test spread…[/b] rolls a card hundreds of times, answering every question at random, and reports:
- errors, such as a rule that can't be worked out
- dead ends, where a roll stops unexpectedly
- cards and results that never came up
- tips, such as an option that can never be offered

Click any item in the report to jump to that card. A spread that can loop forever shows a warning in the top bar while you build.

# Finding your way
- [b]Search[/b] (the magnifier, or [b]Ctrl+F[/b]) finds cards by name, result, question, value or group, opens closed groups and flashes the card.
- Drag with the middle mouse button, or hold [b]Space[/b] and drag, to move around. The mouse wheel scrolls up and down, [b]Shift+wheel[/b] scrolls sideways and [b]Ctrl+wheel[/b] zooms.
- The zoom control at the top right shows the zoom. − and + step it, and the percentage opens [b]Fit spread[/b], [b]Zoom to 100%[/b] and the minimap.
- The [b]minimap[/b] (press [b]M[/b]) shows the whole spread in the corner. Click or drag on it to move there.

## The View menu
- [b]Rules[/b]: show rules in [b]Plain words[/b] ("Subtract 1 from Luck") or as [b]Rule text[/b] (`@luck -= 1`).
- [b]Collapse all tables[/b] or [b]Expand all tables[/b].
- [b]Striped rows[/b] shades every second result row, so long tables are easier to read across.
- [b]Minimap[/b].

# Keyboard shortcuts
## Keys
- [b]F1[/b]: this help
- [b]Ctrl+F[/b]: search
- [b]M[/b]: show or hide the minimap
- [b]Ctrl+Z[/b]: undo. [b]Ctrl+Shift+Z[/b] or [b]Ctrl+Y[/b]: redo
- [b]Ctrl+G[/b]: group the selected cards and groups
- [b]Esc[/b]: clear the selection, or close a window
- In a question pop-up: [b]1–9[/b] pick an option, [b]R[/b] Random, [b]M[/b] or [b]Tab[/b] look at the spread
## Mouse
- [b]Shift-click[/b] a die: roll without the animation
- [b]Right-click[/b]: the menu for what's under the mouse
- [b]Drag on empty space[/b] (Build): a selection box. Add [b]Ctrl[/b] or [b]Shift[/b] to add to the selection
- [b]Middle-drag[/b], or [b]Space[/b] + drag: move around the spread
- [b]Wheel[/b]: scroll. [b]Shift+wheel[/b]: sideways. [b]Ctrl+wheel[/b]: zoom
- A card's bottom-right corner: drag to resize, double-click for its own size
- Double-click the edge of the tray, inspector, list or Book: reset its size
## Touch
- Press and hold: the menu
- Two fingers: move and zoom
