Stage 2 · Intermediate · F5
Speaking to Machines
Under the hood, a model is mostly arithmetic on grids of numbers, and you can learn to write it.
13 lessons · 110 minGentle
About this chapter
You can start from nothing, with no setup and no experience. You will name values, walk a list, choose with a condition, write a recipe of your own, and read an error without flinching. Then numbers arrive in grids, arithmetic hits a whole grid at once, and a picture comes out the other end.
What you will be able to do
- 17 min
What a Program Is
Say what a program is and predict the order its lines run in.
- 28 min
Values and Names
Give a value a name, reuse it, and say when a name may change.
- 38 min
Numbers and Text
Tell a number from text and predict what the plus sign will do.
- 48 min
Lists
Build a list, reach any item by its position, and count from zero.
- 59 min
Do This for Every Item
Write a loop over a list and say what the body does on each pass.
- 68 min
Choosing
Write a condition, read what it returns, and keep only the items you want.
- 79 min
Named Recipes
Write a function, call it with different inputs, and hand a result back.
- 88 min
Reading an Error Without Fear
Read the three parts of an error message and find the line that caused it.
- 910 min
A Grid of Numbers
Read a shape out loud and reach any number in a grid by its address.
- 109 min
Math on Everything at Once
Do arithmetic on a whole grid in one line and predict the shape that comes out.
- 118 min
Draw It Before You Trust It
Draw a set of numbers and name something the summary hid.
- 129 min
One Small Experiment
Load real numbers, check them, compute one thing, and draw the result.
- 139 min
Reading Other People's Code
Work out what an unfamiliar snippet does without asking its author.
Before you start
Nothing to learn first. You can start here.