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. 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 lineExampleWhat it does
Rowrow red: 2-12Adds a row of cells to the card.
Cardcard "Mixed"Starts a new card (only needed for several cards in one description).
Settingpenalties 3Changes how the card looks, e.g. the number of penalty boxes.
Colour definitioncolor mint #2bb39bAdds or changes a named colour.
Comment# a note to selfIgnored.

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:

  1. Rows: one per row line, in the order you write them. Each has a black start arrow on the left and a lock at the end.
  2. Scoring table (Kruisjes / Punten): how many points a number of crosses is worth.
  3. Penalty boxes (Elke mislukte worp: -5) on the right of the scoring table.
  4. Score line: one box per colour, then minus penalties, equals the total.

3. Rows

The general form of a row is:

row [options] [:] cells…

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

WriteYou getNotes
7one cell showing 7Any whole number 0 or more.
2-122, 3, 4 … 12Counts up.
12-212, 11, 10 … 2Counts down.
2..12same as 2-12Alternative spelling.
5-5just 5A range of one.
"A"a cell showing AAny text in double quotes: letters, symbols, emoji, "10+". Long text is squeezed to fit.
""an empty cellUseful for a blank box to write in.
| or ,nothingOptional 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:

OptionEffect
(nothing)Lock in the colour of the last cell.
lock=blueLock in blue (any colour name or #hex).
lock=noneNo 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)

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.

Scoring table: scoring

The table under the rows shows the points for a number of crosses (Kruisjes) in one colour.

WriteTable
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 15Exactly 15 columns of the usual sequence (up to 120).
scoring 1 2 4 7 11 16Your own points: the first number is for 1 cross, the second for 2, and so on. Separate them with spaces or commas.
scoring noneNo table.

Penalties: penalties and penalty

Score line: score

WriteScore 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 yellowExactly these boxes, in this order.
score noneNo 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.

SettingCrossesPointsPenaltyScore
lang nl (default)KruisjesPuntenElke mislukte worp: -5Score
lang enCrossesPointsEach failed throw: -5Score
lang deKreuzePunkteJeder Fehlwurf: -5Summe

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:

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

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.

SettingValuesDefaultMeaning
card"name" (optional)–Start a new card. More
title"name"Card 1, Card 2…Name the current card (same as the name after card).
rowsee Rows–Add a row.
color / colourname #hex [#text-hex]built-in paletteDefine or change a colour. More
langnl, en, denlLanguage of the card's texts.
labelcrosses|points|penalty|score "text"from langReplace one text. {n} in the penalty text becomes the penalty.
scoringauto, none, a count, or a list of pointsautoThe crosses/points table. More
penalties0–204Number of penalty boxes.
penaltya number5Points per penalty box.
scoreauto, none, or a list of coloursautoColour boxes in the score line.
seedany number or wordcard positionWhich random order shuffle(…) gives.
arrowson, offonThe black start triangles left of the rows.
width148mm, 15cm, 6in (30–600 mm)automaticPrinted width of the card. Automatic: cells the same size as on a 148 mm classic card.
copies1–1001How many copies to print.

14. Comments and whitespace

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.

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 11 or your own list to change it.
The score line has boxes in a different order than my rows.
With score auto the boxes follow the palette order (red, yellow, green, blue, …), as on the original cards, whatever order the rows are in. Write score blue green red yellow to 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 width setting.