Card Description Language
The editor draws score cards for Qwixx-style dice games from a short text description. This page explains that description language from the first line to the last option. Every example below is drawn live by the same code as the editor; click Open in editor under an example to try it yourself.
1. Quick start
A card is a list of rows. Each row starts with row, then a colour, then the numbers:
row red: 2-12 row yellow: 2-12 row green: 12-2 row blue: 12-2
That is the whole classic card. Everything else (the start arrows, the locks, the scoring table, the penalty boxes and the score line) is added for you with sensible defaults.
Three things to remember:
2-12counts up from 2 to 12;12-2counts down.- A colour word colours every cell after it, until the next colour word.
- Each line starts with a command:
row,card, or a setting such aslangorpenalties.
2. How a description works
A description is plain text, read one line at a time. Every non-empty line is one command: the first word says what the line does and the rest are its values.
| Kind of line | Example | What it does |
|---|---|---|
| Row | row red: 2-12 | Adds a row of cells to the card. |
| Card | card "Mixed" | Starts a new card (only needed for several cards in one description). |
| Setting | penalties 3 | Changes how the card looks, e.g. the number of penalty boxes. |
| Colour definition | color mint #2bb39b | Adds or changes a named colour. |
| Comment | # a note to self | Ignored. |
Commands are not case sensitive (ROW Red: 2-12 works), and spacing does not matter
except that words must be separated by at least one space.
From top to bottom, a finished card has:
- Rows: one per
rowline, in the order you write them. Each has a black start arrow on the left and a lock at the end. - Scoring table (Kruisjes / Punten): how many points a number of crosses is worth.
- Penalty boxes (Elke mislukte worp: -5) on the right of the scoring table.
- Score line: one box per colour, then minus penalties, equals the total.
3. Rows
The general form of a row is:
row [options] [:] cells…
rowis the command.- The colon is optional and purely decoration:
row red: 2-12androw red 2-12mean the same. The convention in this guide is to put the colon after the row's main colour. - cells is a list of numbers, ranges, text cells, colour words and shuffles (see the next sections).
- The only row option is
lock=…, see Locks. It may stand anywhere in the line.
Rows do not need the same number of cells. A card can have any number of rows (one, four, eight…). The card simply grows to fit its longest row.
row red: 2-12 row blue: 2 4 6 8 10 12 row green: 3 5 7 9 11
4. Cells: numbers, ranges, text
| Write | You get | Notes |
|---|---|---|
7 | one cell showing 7 | Any whole number 0 or more. |
2-12 | 2, 3, 4 … 12 | Counts up. |
12-2 | 12, 11, 10 … 2 | Counts down. |
2..12 | same as 2-12 | Alternative spelling. |
5-5 | just 5 | A range of one. |
"A" | a cell showing A | Any text in double quotes: letters, symbols, emoji, "10+". Long text is squeezed to fit. |
"" | an empty cell | Useful for a blank box to write in. |
| or , | nothing | Optional separators to make long rows easier to read. |
You can mix all of these freely:
row red: 2 3 4-6 "★" 8..10 "" 12
Numbers outside 2–12 are allowed, but the editor shows a warning because two dice can never roll them. Repeating a number in a row is also allowed and also gives a warning.
5. Colours
Every cell needs a colour. A colour word in a row sets the colour for all the cells that follow it in that row.
A row has no colour until you give it one, so row: 2-12 on its own is an error.
Built-in colours
gray is accepted for grey and violet for purple.
Hex colours
You can also write any colour directly as a hex code, e.g. row #ff6f00: 2-12.
Short codes like #f60 work too.
Defining your own colours
color <name> <#hex> [<#text-hex>]
This creates a new colour name, or changes a built-in one. The optional second code is the colour of the numbers; leave it out to use the same colour. A separate number colour is handy for light colours, where numbers in the band colour would be hard to read (the built-in yellow does this).
color mint #2bb39b color sand #f2d27a #b88a12 color red #b0001e # make red darker on this card row red: 2-12 row sand: 2-12 row mint: 12-2
colour is accepted as a spelling of color. Colour names may use letters, digits,
- and _, and must start with a letter. A color line can stand anywhere in the
card, even after the rows that use it.
6. Mixing colours in a row
Because a colour word only changes the colour of the cells after it, you can switch colours as often as you like within one row. The coloured band behind the cells follows the cell colours.
row: yellow 2-4 | blue 5 6 | green 7-10 | red 11 12 row: red 2 3 | green 4-7 | blue 8 9 | yellow 10-12 row: blue 12-10 | yellow 9-7 | red 6-4 | green 3 2 row: green 12 11 | red 10-7 | yellow 6 5 | blue 4-2
Here no colour stands before the colon, so the row starts with no colour and the first word after the colon sets it.
row yellow: 2-4 blue 5 6 would mean exactly the same as the first row's first two parts.
The | characters are optional separators that only make the line easier to read.
On a mixed card, the score line shows one box per colour used, in the fixed order red, yellow, green, blue, … (see score line).
7. Locks
Each row ends with an open padlock. By default the lock takes the colour of the row's last cell.
Change it with the lock= option:
| Option | Effect |
|---|---|
| (nothing) | Lock in the colour of the last cell. |
lock=blue | Lock in blue (any colour name or #hex). |
lock=none | No lock on this row. |
row red lock=none: 2-12 row: yellow 2-11 lock=red 12 row green: 12-2 lock=#000
Write lock=… without spaces around the =.
8. Shuffling
shuffle( … ) puts the cells inside the parentheses in a random order. Cells keep their own colour,
so you can shuffle colours and numbers together.
seed 7 row red: shuffle(2-12) row yellow: 2 3 shuffle(4-10) 11 12 row: shuffle(red 2-4 yellow 5-7 green 8-10 blue 11 12)
- The order is random but repeatable: the same description always gives the same card, so the card does not change while you type, and a share link always shows the same card.
- The
seedsetting picks which random order you get. Change it (to any number or word) to get a new card; keep it to get the same card again:seed 42,seed party-night. - Without a
seed, each card uses its position (card 1, card 2, …) as the seed, so cards in one description differ from each other. - The rows of a card are shuffled one after the other with the same random sequence, so four
shuffle(2-12)rows give four different orders. - A colour word inside a shuffle only applies inside it. A shuffle starts with the colour that was active before it.
- Shuffles may be nested:
shuffle(red 2 3 shuffle(4-6)).
Tip: once you like a shuffled card, you can keep it exactly as is by copying its numbers into a fixed row such as
row red: 10 6 2 8 3 4 12 5 9 7 11.
9. Scoring table, penalties, score line
Scoring table: scoring
The table under the rows shows the points for a number of crosses (Kruisjes) in one colour.
| Write | Table |
|---|---|
scoring auto (default) | 1x, 2x, 3x … up to the longest row's length plus one (for the lock). Points follow the usual sequence 1, 3, 6, 10, 15, … (n crosses are worth 1+2+…+n). A classic card gets 12 columns: 1 to 78. |
scoring 15 | Exactly 15 columns of the usual sequence (up to 120). |
scoring 1 2 4 7 11 16 | Your own points: the first number is for 1 cross, the second for 2, and so on. Separate them with spaces or commas. |
scoring none | No table. |
Penalties: penalties and penalty
penalties 4sets the number of penalty boxes (default 4, from 0 to 20).penalties 0removes the boxes and the minus box in the score line.penalty 5sets the points each box costs (default 5). The label shows it as -5.penalty -5means the same.
Score line: score
| Write | Score boxes |
|---|---|
score auto (default) | One box for every colour used in a cell, in the order of the palette: red, yellow, green, blue, purple, orange, pink, teal, brown, grey, black, then your own colours in the order you defined them, then hex colours in the order they appear. |
score blue green red yellow | Exactly these boxes, in this order. |
score none | No colour boxes (the score line still appears if there are penalty boxes). |
After the colour boxes come − a grey penalty box (only if there are penalty boxes) and = the total box.
The score line disappears completely with score none and penalties 0.
lang en scoring 1 3 6 10 15 21 28 penalties 2 penalty 10 score red blue row red: 2-7 row blue: 7-12
10. Language and labels
The texts on the card come in three languages. The default is Dutch, as on the original cards.
| Setting | Crosses | Points | Penalty | Score |
|---|---|---|---|---|
lang nl (default) | Kruisjes | Punten | Elke mislukte worp: -5 | Score |
lang en | Crosses | Points | Each failed throw: -5 | Score |
lang de | Kreuze | Punkte | Jeder Fehlwurf: -5 | Summe |
Change any single text with label:
label crosses "text"
label points "text"
label penalty "text" # {n} is replaced by the penalty, e.g. -5
label score "text"
lang en
label crosses "Marks"
label penalty "Missed roll {n}"
label score "Total"
row red: 2-12
row blue: 12-2
Use label penalty "" to hide a text completely.
11. Several cards in one description
Start each card with a card line. Its name (optional, in quotes) is shown above the preview and used for file names.
card ["name"]
The rules:
- Settings and
colorlines before the firstcardline apply to every card. - Settings after a
cardline apply to that card only, and win over the shared settings. - Rows written before the first
cardline form a first card of their own (that is how a description without anycardline works). You can name it withtitle "name". - A card with errors is left out of the preview and the print; the other cards still show.
lang en penalties 3 card "Up" row red: 2-12 row blue: 2-12 card "Down" penalties 5 # only this card has 5 penalty boxes row red: 12-2 row blue: 12-2
12. Printing and exporting
- Print cards prints every card at its real size on A4 paper. By default every card uses the same scale, chosen so the classic card is exactly 148 mm wide (the width of A6): a card with longer rows gets wider, a card with fewer rows gets shorter, and the cells are always the same size. The preview shows each card's printed size next to its name. Two classic cards fit on one A4 page. In the print dialog, set the scale to 100% / "actual size" and turn off headers and footers.
copies 6prints six copies of a card. The preview shows a card once, with ×6 next to its name.width 120mm(or12cm,5in) fixes the printed width of a card instead; the height follows.- SVG under each preview downloads a vector file, ideal for a print shop or for editing in Inkscape or Illustrator.
- PNG downloads an image at 300 dpi for the printed width.
- Copy share link puts your whole description in the link, so anyone who opens it sees your cards. Nothing is uploaded; the page works entirely in your browser, also offline.
- Save .txt / Open .txt save and load descriptions as files. The editor also remembers your last description in the browser.
Laminate the printed cards (like the photographed ones) and use a whiteboard marker to play on them again and again.
13. Settings reference
Settings can appear anywhere inside their card; the order does not matter. If a setting appears twice, the last one wins.
| Setting | Values | Default | Meaning |
|---|---|---|---|
card | "name" (optional) | – | Start a new card. More |
title | "name" | Card 1, Card 2… | Name the current card (same as the name after card). |
row | see Rows | – | Add a row. |
color / colour | name #hex [#text-hex] | built-in palette | Define or change a colour. More |
lang | nl, en, de | nl | Language of the card's texts. |
label | crosses|points|penalty|score "text" | from lang | Replace one text. {n} in the penalty text becomes the penalty. |
scoring | auto, none, a count, or a list of points | auto | The crosses/points table. More |
penalties | 0–20 | 4 | Number of penalty boxes. |
penalty | a number | 5 | Points per penalty box. |
score | auto, none, or a list of colours | auto | Colour boxes in the score line. |
seed | any number or word | card position | Which random order shuffle(…) gives. |
arrows | on, off | on | The black start triangles left of the rows. |
width | 148mm, 15cm, 6in (30–600 mm) | automatic | Printed width of the card. Automatic: cells the same size as on a 148 mm classic card. |
copies | 1–100 | 1 | How many copies to print. |
14. Comments and whitespace
#starts a comment that runs to the end of the line, at the start of a line or after a space:row red: 2-12 # the classic row.//works the same way.- Inside a row,
#directly followed by 3 or 6 hex digits is read as a colour (#f60,#2bb39b), not a comment. Put a space after#in comments to be safe. - Empty lines are ignored. Use them to group rows and cards.
- Indentation is ignored, and so is extra space between words.
- A
#inside quotes is text:"#1".
15. Errors and warnings
The panel under the editor lists problems with their line number; click one to jump to that line. The line number is highlighted in the gutter too.
- Errors (red) mean a card cannot be drawn: an unknown command, an unknown colour, a cell without a colour,
a missing
)… The card with the error is left out; other cards still show. Most errors suggest a fix, e.g. Unknown colour "gren". Did you mean "green"? - Warnings (yellow) never stop the card from being drawn. They point at things that are probably a mistake: numbers two dice can't roll (below 2 or above 12), a number repeated within a row, a colour word at the end of a row with no cells after it, or a very long row.
16. Recipes
The three photographed cards
Classic, mixed colours and shuffled numbers, as found in the box:
card "Classic" row red: 2-12 row yellow: 2-12 row green: 12-2 row blue: 12-2 card "Mixed colours" row: yellow 2-4 | blue 5 6 | green 7-10 | red 11 12 row: red 2 3 | green 4-7 | blue 8 9 | yellow 10-12 row: blue 12-10 | yellow 9-7 | red 6-4 | green 3 2 row: green 12 11 | red 10-7 | yellow 6 5 | blue 4-2 card "Shuffled numbers" row red: 10 6 2 8 3 4 12 5 9 7 11 row yellow: 9 12 4 6 7 2 5 8 11 3 10 row green: 8 2 10 12 6 9 7 4 5 11 3 row blue: 5 7 11 9 12 3 8 10 2 6 4
A new random card every game night
card "Game night" seed 2026-12-04 # change the seed for a new card copies 4 # one for every player row red: shuffle(2-12) row yellow: shuffle(2-12) row green: shuffle(2-12) row blue: shuffle(2-12)
Everything shuffled
Each row has every number once, and the colours are spread at random too.
seed rainbow row: shuffle(red 2-4 yellow 5-7 green 8-10 blue 11 12) row: shuffle(red 5-7 yellow 8-10 green 11 12 blue 2-4) row: shuffle(red 8-10 yellow 11 12 green 2-4 blue 5-7) row: shuffle(red 11 12 yellow 2-4 green 5-7 blue 8-10)
Six colours
lang en color mint #2bb39b row red: 2-12 row orange: 2-12 row yellow: 2-12 row mint: 12-2 row blue: 12-2 row purple: 12-2
Middle-out rows
Rows that start at 7, the most likely roll, and work outwards.
row red: 7 6 8 5 9 4 10 3 11 2 12 row yellow: 7 8 6 9 5 10 4 11 3 12 2 row green: 7 6 8 5 9 4 10 3 11 2 12 row blue: 7 8 6 9 5 10 4 11 3 12 2
A short, quick game
lang en scoring 1 2 4 7 11 16 22 penalties 3 row red: 2 4 6 8 10 12 row yellow: 2 4 6 8 10 12 row green: 3 5 7 9 11 row blue: 3 5 7 9 11
Plain look for a black and white printer
color red #222 color yellow #555 color green #888 color blue #aaa #444 arrows off row red: 2-12 row yellow: 2-12 row green: 12-2 row blue: 12-2
17. Formal grammar
For the precise rules, here is the language in EBNF. Keywords are case-insensitive. Text after # or //
at the start of a line or after whitespace is a comment (except # followed by a hex colour inside a line).
description = { line } ;
line = [ command ] [ comment ] NEWLINE ;
command = card | title | row | colourdef | setting ;
card = "card" [ name ] ;
title = "title" name ;
name = QUOTED | WORDS ;
row = "row" { item } ; (* the first ":" is ignored *)
item = colour | cell | range | shuffle | option | "|" | "," ;
colour = COLOURNAME | HEX ; (* colours the following cells *)
cell = NUMBER | QUOTED ;
range = NUMBER ( "-" | ".." ) NUMBER ; (* up or down, inclusive *)
shuffle = "shuffle" "(" { item } ")" ; (* nesting allowed, no options inside *)
option = "lock=" ( COLOURNAME | HEX | "none" ) ;
colourdef = ( "color" | "colour" ) IDENT HEX [ HEX ] ;
setting = "lang" ( "nl" | "en" | "de" )
| "label" ( "crosses" | "points" | "penalty" | "score" ) name
| "scoring" ( "auto" | "none" | NUMBER | NUMBER NUMBER { NUMBER } )
| "penalties" NUMBER
| "penalty" [ "-" | "+" ] NUMBER
| "score" ( "auto" | "none" | colour { colour } )
| "seed" name
| "arrows" ( "on" | "off" )
| "width" DECIMAL [ "mm" | "cm" | "in" ]
| "copies" NUMBER ;
NUMBER = digit { digit } ;
HEX = "#" 3 or 6 hex digits ;
IDENT = letter { letter | digit | "-" | "_" } ;
QUOTED = '"' { any character except '"' } '"' ;
18. Cheat sheet
# comment // also a comment
card "Name" start a new card (optional)
row red: 2-12 red cells 2…12, lock in red
row green: 12-2 counting down
row: yellow 2-4 | blue 5 6 | red 7-12 mixed colours ( | is optional)
row red: 10 6 2 8 3 4 12 5 9 7 11 any order
row red: shuffle(2-12) random order (see seed)
row: shuffle(red 2-6 blue 7-12) shuffle colours and numbers
row red: 2-12 "★" "" text cell and empty cell
row red lock=none: 2-12 no lock (lock=blue: blue lock)
row #ff6f00: 2-12 hex colour
color mint #2bb39b [#text] new or changed colour
lang nl | en | de card language (default nl)
label penalty "Missed {n}" replace a text (crosses/points/penalty/score)
scoring auto | none | 12 | 1 3 6 10 ... points table
penalties 4 number of penalty boxes
penalty 5 points per penalty box
score auto | none | red blue ... colour boxes in the score line
seed 42 pick a different random shuffle
arrows on | off start triangles
width 148mm fixed printed width (default: automatic)
copies 4 copies to print
19. FAQ
- My yellow numbers are hard to read on paper.
- Give yellow a darker number colour:
color yellow #f4c300 #b88a00. - Why does my shuffled card stay the same when I edit it?
- On purpose: shuffles are tied to the
seed, so the card doesn't jump around while you type and a share link always shows the same card. Change the seed for a new order. - Why does the scoring table go up to 12x when my rows have 11 cells?
- Closing a row with the lock counts as an extra cross, so the table goes one further than the longest row.
Use
scoring 11or your own list to change it. - The score line has boxes in a different order than my rows.
- With
score autothe boxes follow the palette order (red, yellow, green, blue, …), as on the original cards, whatever order the rows are in. Writescore blue green red yellowto choose the order yourself. - Can I use the cards without internet?
- Yes. Download the folder and open
index.html; everything runs in the browser. Share links work as long as the other person has the page too. - The printed card is the wrong size.
- Set the print dialog's scale to 100% (also called "actual size", not "fit to page"). To force an exact size, use the
widthsetting.