← Teacher guides

Learning with AI: how the ideas build

Every pathway teaches the same few coding ideas, each in its own order and its own tool. Some ideas must come before others; the rest can come in any order. Part 1 shows which is which, what each idea looks like in each tool, and where each pathway first teaches it. Part 2 adds the few ideas each pathway has of its own.

Part 1: ideas every pathway shares

Steps in order
Remembering things
Repeating
Deciding
Lists
Building blocks
Toolkit: use when a task needs it

Bold border a hinge idea: give it extra time and check it's solid before moving on. Lines join an idea to what it needs first (the one above it; on a phone, tap an idea to see its lines). Everything builds on steps in order, so those lines are left out. The toolkit needs nothing and can come whenever a task needs it.

Click an idea to see what it needs and what it leads to.

Why these ideas matter, even if coding isn't your strength

You don't need to be a programmer to teach or use these ideas. They are about what a program does, not the exact words you type: the same idea looks different in blocks, Python and JavaScript, and the plain words below are enough to talk about it.

The ideas also matter when an AI tool helps write some of the code, as it increasingly does. Someone still has to say precisely what the program should do, check that it does it, and say what to change when it doesn't. That takes the ideas on this page, the hinge ideas most of all: a value that changes as the program runs, the loop counter, and the yes-or-no questions, where mistakes hide at the edges (does “more than 10” include 10?). Typing the code by hand may matter less than it did; knowing what each part does, and predicting what it will do, matters as much as ever.

The shared ideas, in plain words

Grouped as on the map. Each row says what the idea means, then how it looks in each pathway and the lesson where that pathway first teaches it. Pathways are options, not a sequence: a gap means that pathway teaches the idea later or leaves it out.

Steps in order

Three numbered steps, followed one after another in order1 move2 turn3 moveone step at a time, in the order written

Where every pathway starts: the computer follows instructions exactly, in order.

IdeaAI FoundationsDoes AI Help Us Learn?AI and society
Steps in order

The computer does each step in the order you write it, one at a time, like following a recipe.

Can you predict the next word? · AI Foundations

Does AI help us learn? · Does AI Help Us Learn?

Which kind of AI is it? · Who Does AI Affect?

Remembering things

A box called score whose value changes from 0 to 1 to 2 as the program runsscore0score1score2+1+1the same box, a new value each time

Variables let a program keep a value and change it as it runs.

IdeaAI FoundationsDoes AI Help Us Learn?AI and society
Variables

A named box that holds a value, such as a score, so the program can use it later.

Needs first: Steps in order

No lesson teaches this yet

No lesson teaches this yet

No lesson teaches this yet

Changing a variable (x = x + 1) hinge

Working out a new value from the old one, such as adding 1 to the score. The box changes as the program runs.

Students who read = as "equals, for ever" get stuck here.

Needs first: Variables

No lesson teaches this yet

No lesson teaches this yet

No lesson teaches this yet

Joining text

Sticking text and values together to make a message, like "Score: 5".

Needs first: Variables

No lesson teaches this yet

No lesson teaches this yet

No lesson teaches this yet

Asking the user

Asking the person using the program for something, and keeping their answer in a variable.

Needs first: Variables

No lesson teaches this yet

No lesson teaches this yet

No lesson teaches this yet

Repeating

A loop that goes round four times, with a counter showing 0, 1, 2 and 3repeat4 times0123the counter, each time roundstarts at 0

Loops save writing the same steps again, and the counter lets each time round be different.

IdeaAI FoundationsDoes AI Help Us Learn?AI and society
Repeat a number of times

Doing the same steps a set number of times, without writing them out again.

Needs first: Steps in order

No lesson teaches this yet

No lesson teaches this yet

No lesson teaches this yet

The loop counter hinge

A variable that counts which time round the loop it is, like lap 3 of 5, so each time round can be a bit different.

Students often expect it to start at 1. It starts at 0.

Needs first: Repeat a number of times, Changing a variable

No lesson teaches this yet

No lesson teaches this yet

No lesson teaches this yet

Deciding

Is the score more than 10? On a number line, 7 to 10 are no and 11 to 13 are yes; 10 itself is no, because 10 is not more than 1078910111213Is the score more than 10?noyes10 is no: it isn’t more than 10.“At least 10” would say yes. Edges like this hide mistakes.

A yes-or-no question lets the program choose what to do.

IdeaAI FoundationsDoes AI Help Us Learn?AI and society
Yes-or-no questions (comparing) hinge

A question with a yes-or-no answer, such as "is the score more than 10?". Every decision is built on one.

Most mistakes are in the question itself, often at the edge: does "more than 10" include 10? (It doesn’t.)

Needs first: Variables

No lesson teaches this yet

No lesson teaches this yet

No lesson teaches this yet

If

Run some steps only when the answer to a question is yes.

Needs first: Yes-or-no questions

No lesson teaches this yet

No lesson teaches this yet

No lesson teaches this yet

Else

What to do instead when the answer is no.

Needs first: If

No lesson teaches this yet

No lesson teaches this yet

No lesson teaches this yet

And, or

Joining two questions: both must be yes (and), or either one can be (or).

Needs first: If

No lesson teaches this yet

No lesson teaches this yet

No lesson teaches this yet

True or false in a variable

Keeping a yes-or-no answer in a variable, such as whether the game is over.

Needs first: Yes-or-no questions, Variables

No lesson teaches this yet

No lesson teaches this yet

No lesson teaches this yet

Repeating until something changes

A loop that runs a round, asks whether lives are still above 0, goes round again on yes and stops on noplay a roundlives > 0 ?yes: againnostoprepeats as long as the answer is yes

A loop that keeps going while a question is yes: repeating and deciding together.

IdeaAI FoundationsDoes AI Help Us Learn?AI and society
While loops

Keep repeating as long as the answer to a question is yes: for when you don’t know how many times.

Needs first: Repeat a number of times, Yes-or-no questions

No lesson teaches this yet

No lesson teaches this yet

No lesson teaches this yet

Reacting to events

A button press sets off a set of steps that were waiting for itApresswhen A is pressed:add 1 to scorewaits until something happens

Code that waits for a press, a click or a message. Early in MakeCode, later in Python and Web.

IdeaAI FoundationsDoes AI Help Us Learn?AI and society
Events (code that runs when something happens)

Steps that wait, then run when something happens, such as a button press or a click.

Needs first: Steps in order

No lesson teaches this yet

No lesson teaches this yet

No lesson teaches this yet

Lists

A list of four items in slots numbered 0 to 3, with an arrow stepping through each onecat0dog1fish2bird3placefor each item: one after another

Keeping many values under one name, then working through them.

IdeaAI FoundationsDoes AI Help Us Learn?AI and society
Lists

One name for a whole set of values, kept in order, like a class roll.

Needs first: Variables

No lesson teaches this yet

No lesson teaches this yet

No lesson teaches this yet

A place in a list

Getting one item by its place in the list. The first place is 0, not 1.

Needs first: Lists

No lesson teaches this yet

No lesson teaches this yet

No lesson teaches this yet

For each item

Doing the same steps once for each item in a list, however long it is.

Needs first: Lists, Repeat a number of times

No lesson teaches this yet

No lesson teaches this yet

No lesson teaches this yet

Building blocks

A named job called double: a value goes in as a parameter and an answer comes backdouble5inparameter10outreturnedwrite it once, use it with one line

Naming a set of steps so it can be reused, given values and hand back answers.

IdeaAI FoundationsDoes AI Help Us Learn?AI and society
Functions

Giving a set of steps a name, so you can use them again with one line.

Can come early: a named chunk such as square() needs nothing but steps in order.

Needs first: Steps in order

No lesson teaches this yet

No lesson teaches this yet

No lesson teaches this yet

Parameters

A value you hand to a function so it does the job a little differently each time, like a square of size 50.

Needs first: Functions, Variables

No lesson teaches this yet

No lesson teaches this yet

No lesson teaches this yet

Returning a value

A function working something out and handing the answer back, like a calculator button.

Needs first: Functions

No lesson teaches this yet

No lesson teaches this yet

No lesson teaches this yet

Toolkit: use when a task needs it

A die showing four for random numbers, and seven dots shared into pairs with one left over for remainderrandom 1 to 61 left7 % 2 = 1

Handy techniques that nothing else builds on. Bring them in whenever a task needs them.

IdeaAI FoundationsDoes AI Help Us Learn?AI and society
Random numbers

A different number each time the program runs, for dice, games and surprises.

No lesson teaches this yet

No lesson teaches this yet

No lesson teaches this yet

Remainder (%)

What’s left over after dividing. Handy for doing something every second (or third) time.

No lesson teaches this yet

No lesson teaches this yet

No lesson teaches this yet

Part 2: what each pathway adds

Each pathway also has a few ideas of its own. These are often what a teacher new to that tool finds hardest, because they are about the tool's world (pages, devices, games, text programs) rather than coding in general. Each says which shared ideas it builds on.

Web

The same nested boxes twice: on the left plain, labelled what it is; on the right coloured by CSS, labelled how it lookswhat it is (HTML)sectionh2p+ CSShow it looks (CSS)boxes inside boxes; change the look, not the content

Making pages: what each part is, how it looks, and how code can change it.

IdeaLooks likeFirst taught in
What it is, and how it looks

HTML says what each part of a page is (a heading, a list, a link). CSS says how it looks. You can change the whole look without touching the content.

Builds on: Steps in order

<h1>My club</h1>

h1 { color: teal; }

Rules and selectors · Structure and style a page

Boxes inside boxes

Every part of a page is a box, and boxes sit inside other boxes, like folders inside folders. Laying out a page means arranging those boxes.

Builds on: What it is, and how it looks

<section>
  <h2>News</h2>
  <p>…</p>
</section>

Tags inside tags · Structure and style a page

One page, every screen

The same page rearranges its boxes to fit a phone or a big screen, instead of making a page for each.

Builds on: Boxes inside boxes

.cards { display: flex;
         flex-wrap: wrap; }

Fit any width · Layout and components

Code can change the page

JavaScript can find a part of the page and change it after the page has loaded, for example when someone clicks a button.

Builds on: Boxes inside boxes, Events

document.querySelector("h1")
  .textContent = "Welcome back!";

Find and change · The DOM and the browser console

MakeCode: micro:bit

A micro:bit running forever, reading a light level as a number, and sending a message by radio to another micro:bitforeverlight: 180radio1reactsanother micro:bit

A small computer you can hold: it runs all the time, senses the world and talks to other micro:bits.

IdeaLooks likeFirst taught in
A program that never stops

A micro:bit program usually runs in a "forever" loop, checking and reacting again and again until it is switched off, instead of running once and finishing.

Builds on: Repeat a number of times

forever
show icon ♥
show icon ♡

Again and again · micro:bit Foundations

Reading the real world

Light, tilt and temperature arrive as numbers, so the program can store them, compare them and decide what to do.

Builds on: Variables, Yes-or-no questions

forever
if light level < 50 then
show icon ☾

Sensors are numbers · micro:bit Foundations

Devices talking to each other

One micro:bit sends a number or a word by radio, and every micro:bit in the same group can receive it and react.

Builds on: Events

radio send number 1
on radio received number
show number

Send and receive · micro:bit: talk and play

MakeCode: Arcade

Three frames of a game: a sprite moves a little each frame and, in the third, touches a coin and scores a pointframe 1frame 2frame 3+1move a little, check, redraw: many times a second

Making games: everything moves a little, many times a second.

IdeaLooks likeFirst taught in
Sprites

Each character or object in a game is a sprite: a small picture with a position and a speed that the game keeps track of.

Builds on: Variables

set hero to sprite of kind Player
move hero with buttons

Sprites on the screen · Arcade Foundations

When two sprites touch

When two sprites overlap, an event runs: a coin is collected, a life is lost. The kind of each sprite decides which event.

Builds on: Sprites, Events

on Player overlaps Food
change score by 1

Overlaps and kinds · Arcade Foundations

Every frame

Many times a second the game moves everything a little, checks what has happened and redraws the screen. Code can run on every one of those frames.

Builds on: Repeat a number of times, If

on game update
if hero x > 150 then
game over

If, every frame · Arcade Foundations

Python

A console conversation where the program asks a name and replies, and the text 12 joined to the text 1 giving 121 while the number 12 plus 1 gives 13Your name? SamHi SamAge? 12a program that talkstext or number?"12" + "1" → "121"12 + 1 → 13typing gives text first

From drawing to text programs and data: what Python adds once students leave the turtle.

IdeaLooks likeFirst taught in
A program that talks

Printing text out and reading what someone types in, so a program can hold a conversation instead of drawing a picture.

Builds on: Asking the user, Joining text

name = input("Your name? ")
print("Hi " + name)

Print text · Console bridge: text in, text out

Text that looks like a number hinge

Whatever someone types arrives as text, even "12". It has to be turned into a number before you can do sums with it.

Students are often surprised that "12" + "1" gives "121".

Builds on: Asking the user, Variables

age = int(input("Age? "))
print(age + 1)

Text into numbers · Console bridge: text in, text out

Data that lasts

Saving to a file so the data is still there after the program closes, like a game that remembers your progress.

Builds on: Lists

with open("save.txt", "w") as f:
    f.write(str(score))

Save the game · Deeper Python in the console

Read from each lesson's introduces: tags. MakeCode blocks are drawn here as plain shapes in MakeCode's colours, not screenshots.