Lesson 0 — Meet Snake

Lesson 0 of 28 — Snake Training

Lesson 0 — Meet Snake

Lesson 0 of 28
Goal Play the finished game before you build it.

This is what you'll build by the end of the course: the classic Snake game that lived inside every Nokia phone in the late 90s.

Click Practice to flip to the workspace — the game is already running in the Preview tab. Take a moment to play.

How to play:

  1. Click the game first so it gets the keyboard focus.
  2. Use the arrow keys (or WASD) to move.
  3. Eat the small square to grow. Don't hit the walls or yourself.
  4. When you die, press R to restart.

If you peek into the file tree on the left side of the workspace, you'll see the three files that make this work: index.html, style.css, and main.js. The whole thing is around 120 lines of code — nothing magical.

When you're ready, come back here (click ← Lesson in the top bar) and click Next lesson → to start building it from scratch.

I'm stuck — show hint

If keys don't seem to do anything: click inside the green game area first — iframes only receive keyboard events when they have focus.

Terminal
git terminal coming in Part 5d — for now this is just a placeholder.