LEVEL 9
Reading a diff
Spot the difference between before and after.
press Enter ↵
Coding agent (pretend: scripted, not a real AI)

The agent waits for your prompt.

📁 Documents\my-site

No files yet.

Lesson 69: Reading a diff

Level 9, Be the Boss: Review, Approve, Plan. Red lines go out, green lines come in. The new word: diff. It follows lesson 68, Level 8 test: Agent Starter. Next comes lesson 70, Approve or deny.

What the lesson explains

Reading a diff. Spot the difference between before and after.

Red out, green in. A diff shows only the lines that change. red goes out; green comes in; one line changed.

What you do first

Read the diff. Which line goes out (the red one)? The answer: "print("Hello")".

The files on the practice computer

This lesson works in one folder. At the start, Documents\my-project holds backups\, club\, games\, images\, my-games\, greet.py, hello.py, hi.py, list.txt, notes.txt.

Along the way you save hello.py in Documents\my-project. Lesson 70 opens with the files just as you leave them.

What you practise

Diff Detective, "Read the diff": Which line goes out (the red one)? The answer: "print("Hello")". Then: Which file does it change? The answer: "hello.py". Then: The pretend agent says: "Here it is again: hello.py says Hello, Sam! May I change it?" It asks to change hello.py. The right answer is Allow: it does what you asked, and nothing more.

Fix it, "The sneaky red line": The pretend agent says: "I only added one line to greet.py: a welcome for Sam." It asks to change greet.py. The right answer is Deny (There is a red line too: it deleted a line you did not ask about!).

In your head, "Picture the diff": You ask it to add one line. What should the diff show? The answer: "One green line, and no red".

What PlayBuddy and PlayType say

PlayType: "Welcome to Level 9! A diff is a spot-the-difference game for code."

PlayBuddy: "Red lines go out. Green lines come in. Read them both!"

Help in every lesson

Everything happens on a pretend computer in your browser, so nothing touches your real files. PlayBuddy and PlayType stand beside the board, cheer you on and say when it is your turn.

A green ring shows where to click the first time. After that you do it on your own, and if you slip twice the ring comes back.

Stars

The lesson has 5 things to do. Up to one slip in ten gives three stars, up to one in four gives two, and finishing always gives at least one. Stars and progress are saved in this browser only; there is no account.

About DayOneCode

DayOneCode is an independent learning site, not affiliated with or endorsed by Anthropic. Claude and Claude Code are trademarks of Anthropic.