cools maths gamesSurprise me

Block Code Maze

Snap code blocks into a program that guides an astronaut through a pipe maze to the flag.

Block Code Maze title screen
  • Partly works on mobile
Report a problem

Turn your phone sideways for a bigger view of this game.

Block Code Maze is a beginner coding puzzle where you build programs from colored blocks instead of typing. Each program guides an astronaut through a network of white pipes. The goal is to reach the red flag on all ten levels, using loops and decisions as the mazes grow.

How Block Code Maze Works

On the left you see the pipes, the astronaut and the flag. On the right are a gray toolbox and a white workspace. Pull blocks across and click them together in a column. The column, read from the top, is your program.

Run Program sends the astronaut through each block in turn. Reach the flag and a message reveals the JavaScript behind your stack, then OK moves you on. Hit a wall or stop early and you press Reset to try again.

New blocks arrive as you go. Loops let one short stack replace a long list of steps, and later mazes need blocks that test whether a path is open. Many levels also cap your block count.

Your First Few Minutes

  1. Trace the path from the astronaut to the flag with your eyes.
  2. Count the forward steps and turns you need.
  3. Drag move forward and turn blocks into the workspace in that order.
  4. Press Run Program and watch where the astronaut goes.
  5. If it misses, press Reset and fix the step that went wrong.

Controls for Block Code Maze

Keyboard, mouse and touch controls for Block Code Maze
To do thisMouseTouch screen
Add a block to your programDrag it from the gray toolbox into the white workspaceDrag it with your finger
Join blocksDrop a block just under or inside another until it clicks in placeDrop it under or inside another block
Remove a blockDrag it onto the trash can or back to the toolboxDrag it onto the trash can
Change a direction in a blockClick the small drop-down arrow on the blockTap the drop-down arrow
Run or stop the programClick Run Program, then ResetTap Run Program, then Reset
Jump to another levelClick a dot or number at the topTap a dot or number

What It Trains

The game teaches basic coding ideas in order: running steps one after another, repeating with loops and choosing with if blocks. You see a long list of steps shrink into one loop that does the same job.

It also trains spatial thinking. Turns are from the astronaut’s point of view, so you have to picture which way it faces at each step.

Strategy Notes

  • Plan the path first. Tally the moves you need before dragging anything.
  • Spot repeats. A pattern like forward, turn left belongs inside one loop.
  • Read the block budget. A tiny allowance is a hint to use a loop or a check.
  • Think from the astronaut’s view. When it walks down the screen, its left is your right.
  • Follow one wall. In the last mazes, keep going forward and turn when a side opens.

Good to Know

Progress saves in your browser. Levels are short, so it fits well into a quick break. Seeing the generated JavaScript after every win is a gentle bridge to typed code.

Block Code Maze questions and answers

Do I need to type any code?

No. You build every program by dragging and stacking blocks. After each solved level, the game prints the JavaScript version of your stack, so you can see how they map to real code.

What do I do if the astronaut stops short?

Press Reset, look at where it went wrong and change your blocks. Walking into a wall stops the run, and the astronaut spins briefly.

What new blocks show up in later levels?

The opening levels only need moving forward and turning. A repeat until loop comes next, and later you get if path and if-else, which look for open routes.

Are levels saved?

Yes. Your browser remembers solved levels, so the progress dots up top are still filled in next time on that device.

Games that use coding like Block Code Maze

Different rules, same kind of thinking.

Try something from another shelf