Constants
You will learn
The six pieces of a constant declaration and what each one does.
pub const WIDTH : u8 = 8; reads left to right: pub makes the name visible to other modules, const says the value is fixed, WIDTH is the name, u8 is the type, 8 is the value, and the semicolon ends it. Constants are what this site's test runner can check: the lesson spec declares WIDTH, HEIGHT and AREA and tests that 8 times 4 is 32.
Try it
Change AREA in the lesson spec to 33 and watch which test fails.

The six pieces of a t27 constant declaration in one table. Lesson 4 of the t27 basics course.
specs/basics/04_constants.t27
// SPDX-License-Identifier: Apache-2.0
; t27 basics, lesson 4: Constants.
; A constant gives a name, a type and a value, and the name never changes its value.
module basics_04_constants;
pub const WIDTH : u8 = 8;
pub const HEIGHT : u8 = 4;
pub const AREA : u8 = 32;
test area_is_width_times_height {
assert WIDTH * HEIGHT == AREA;
}
All lessons
Module 1 · A spec file
What a .t27 file holds: a module line, prose lines and comments.
Module 2 · Values and types
Constants, the width of a whole number, and true, false and text.
Module 3 · Arrays, trits and expressions
Lists of values, the three values of a trit, and what operators compute.
Module 4 · Tests and functions
A test block, several small tests in one spec, and a function with typed inputs.
Module 5 · Inside a function
Names with let and var, choices with if and switch, and loops.
Module 6 · Visibility and your own types
What pub shares with other modules, and the structs and enums you declare.
Module 7 · Modules, rules and gen-ts
Reading another module, stating a rule that always holds, and a spec turned into TypeScript.
Module 8 · The compiler and tri
The backends t27c writes, the stages it reads a spec in, and the tri command.
Module 9 · Errors, a program, what next
Reading a compiler error, one small complete program, and the course to take next.