Your First Game: The Pixel Lab · Lesson 3 ⏱ ~30 min

Data vs code: the world lives in a file.

Right now, your computers are trapped inside the code. In this lesson you'll set them free — and discover the idea that quietly runs most of the software you use: content is data, and data is just a file anyone can edit.

The problem with hardcoding

Ask yourself: if you wanted a fifth computer in the lab, what would you do? Right now the answer is "prompt Claude to edit the game code," because the computers — their names, their colors, how many exist — are woven into the code. Programmers call this hardcoding, and they say it the way you'd say "load-bearing wallpaper."

The fix is one of the oldest, best ideas in software: separate what the app is from what the app shows. The code should know how to draw a computer. Which computers exist — that belongs in a plain file the code reads when it starts.

Step 1 — the extraction

The prompt

I want to separate the game's content from its code. Move the computers into a data file called lab-data — each entry should have a name, a one-line summary, a folder path, and a screen color. The game should read that file when it loads and create one computer per entry: three entries, three computers; six entries, six desks arranged sensibly. The panel that opens on E should show the entry's name, summary, and path.

One thing to know: I open this game by double-clicking the HTML file, no web server — make sure loading the data still works that way.

That last paragraph is you preventing a booby trap, and it deserves a word. Browsers block pages opened from a plain file from fetching other files — a security rule you'd otherwise discover as a mysteriously empty room and a cryptic console error. By saying how you run the game, you let Claude pick a loading approach that works (it'll likely make the data a lab-data.js file the page includes directly — same idea, same editability, zero drama).

🪤If you hit it anyway — empty room, console says something about "CORS" or "fetch" — don't spiral. Paste the error and add: "I'm opening the file directly by double-clicking, not through a server — make the data loading work that way." One round, fixed.

Step 2 — open the data file and just look at it

Ask Claude to show you the file, or open it in any text editor. It'll look something like:

const LAB_DATA = [
  {
    "name": "Computer 1",
    "summary": "Placeholder — a real project goes here soon.",
    "path": "~/somewhere",
    "screenColor": "#38e1ff"
  },
  ...
];

Braces, quotes, commas — this format is called JSON, and it's how most of the software world writes down structured facts. You don't need to memorize its rules. You just need to see what it is: not code. No logic, no instructions. A list of facts, sitting in a file, waiting to be read. State, at rest.

Step 3 — the moment

Now, in that text editor, by hand, without Claude:

  1. Change one computer's name to "Franklin". Save. Refresh the game.
  2. Copy an entire entry (from { to }, mind the comma between entries), paste it below, change its name. Save. Refresh.

A computer named Franklin. A fifth desk that didn't exist a minute ago. You changed an app by editing a text file. No prompts, no code, no permission from anyone. If it feels almost too easy — that's the point. The hard part (code that reads data and draws accordingly) is done and never needs touching again; the living part (the data) is now in the easiest possible format to change.

lab-data facts in a file read the code draws one per entry 🖥️🖥️🖥️ the world you · Claude · anything can edit the facts
The code never changes again. The data is where life happens. Hold that thought for lesson 4.

Why this is the most transferable idea in the course

Look around and you'll see this pattern absolutely everywhere:

  • A restaurant's online menu: the site is code; today's dishes and prices are data someone edits.
  • A store's product pages: one page design, a thousand products of data.
  • This very website: the AI Radar page is a fixed page that reads a data file of headlines and model prices; I refresh the data, never the page. You now know its whole secret.

And for you, practically: when you build things from now on — a menu, a price list, a portfolio — tell Claude Code from the start: "keep the content in a separate data file so I can edit it myself." You'll be able to update your own projects forever, in a text editor, for free, without needing anyone. That sentence is a superpower disguised as a chore.

💾Save point: "Commit this — the lab is data-driven now." Next lesson, that data file stops being placeholder and starts being your actual life.

You can now…

  • Say what hardcoding is and why it traps content
  • Have Claude split any project into code + data file
  • Edit JSON by hand — rename things, add entries — without fear
  • Spot the data-vs-code pattern in menus, stores, and dashboards
Want the course by email? Lessons in your inbox, plus new ones as I write them.

Running a business and would rather this get built for you? That's literally my job — start with the free audit.