Dotdown™ · colors

Read a long calculator at a glance

The Dotdown™ box colors what you type. It changes nothing in the calculator. It only makes a long one easier to look at and to change.

What each color means

Each sample below is colored by the same code as the box.

WhatLooks likeMeaning
Command
.input qty: Quantity
The dot command: .input, .list, .constant, .module, .sect and the steps .r1, .r2. Bold blue.
Name
.input qty: Quantity
The name you give a variable, list, constant or module, and the keys inside a constant or module. Teal.
Positive
.input qty: Quantity positive
The word positive on an input. Red, bold.
Number
.r1 Tax: price × 0.06
Numbers in a formula, and the values in a constant. Pink.
Operator
.r1 Total: (a + b) ÷ 2
Operators and brackets in a formula. Gray, bold.
Keyword
.r1 Fee: if qty >= 10 and not vip = 1 then 0 else sqrt(qty)
if, then, else, and, or, not, and every function name. Purple, bold.
Step result
.r2 Tax: r1 × 0.06
r1, r2 … in a formula, the result of an earlier step. Teal, bold.
Braces
.constant rice { kcal: 130 }
The { } of a constant, a module or the settings. Gray, bold.
Info and section
---
Bulk order price
---
.sect Your quote
The info block at the top, a # title, and the title after .sect. Dark gray, bold.
Comment
// the discount starts above 100
Lines starting with //. Pale gray italic. Notes to yourself, ignored.

Finding your way in a long calculator

// Quote for printing
.sect Pick your paper
.constant art { cost: 12 }
.constant kraft { cost: 8 }
.module paper: Paper { items: art, kraft; sum: cost }
.sect Your quote
.input copies: Copies positive
.r1 Print (RM): copies × paper.cost
.r2 Discount (RM): if copies >= 100 or r1 > 1000 then r1 × 0.1 else 0
.r3 Total (RM): r1 − r2
  • Find a step. The bold blue .r commands run down the left edge. Teal r1 inside a formula shows which earlier step it leans on.
  • Find the decisions. Purple is only ever a keyword or a function, so every if, and and sqrt stands out.
  • Find the fixed numbers. Pink numbers in a formula are typed into it. If one should be something you can change, make it a constant.

Combine them with find and go to line.

What the colors do not do

They are a guide for your eyes, not a check. The coloring reads one line at a time, so an odd line can come out in a color you did not expect. That does not mean it is wrong, and a line that looks right can still be an error. The error list under the box is what checks the calculator.

The colors are the same for everyone and are not saved with the calculator.

Open the builder