cools maths gamesSurprise me

Robot Coder

Program a little robot's whole route in advance, then watch it run without a chance to fix mistakes.

Robot Coder title screen
  • Works on mobile
Report a problem

Robot Coder is a programming puzzle where you plan every move before anything happens. A robot waits on a grid next to colored items and matching targets. You line up a list of commands, press play, and the robot carries them out exactly, mistakes included. The goal is to bring each item to the target of its color.

How Robot Coder Works

Your program is a row of symbols. The green arrow steps forward one square, the curved arrows turn on the spot, and the blue up and down arrows take or drop an item. The robot always acts on the square directly in front of it, so it has to face an item to pick it up.

The robot can carry one thing at a time. It may set an item down on an empty square and come back for it later. Once you hit play, you cannot edit a step, though you can cancel the run and reset the board.

A loop wraps part of the program and repeats it two to nine times. After three tutorials, four themed groups add 21 more levels as you progress. Solving five levels unlocks an editor where you build maps up to 10 by 10.

Your First Few Minutes

  1. Open the first tutorial and count the squares between the robot and the item.
  2. Add forward steps and turns until the robot faces the item, then add a take.
  3. Plan the trip to the matching target and finish with a drop.
  4. Press play and watch the highlighted symbol to follow each step.
  5. If it fails, read the message, reset and fix the step that went wrong.

Controls for Robot Coder

Keyboard, mouse and touch controls for Robot Coder
To do thisKeyboardMouseTouch screen
Add a step forwardUnderscore (_)Click the forward arrow keyTap the forward arrow key
Turn left or right< or >Click a turn keyTap a turn key
Take or drop an itemUp arrow (take), Down arrow (drop)Click the up or down arrow keyTap the up or down arrow key
Add a repeat loopType a number from 2 to 9, then + or - to change itClick the loop key, then plus or minusTap the loop key, then plus or minus
Move the cursor or deleteLeft/Right arrows, Home, End, BackspaceClick the left, right or delete keysTap the left, right or delete keys
Run the robotEnterClick the play buttonTap the play button

What It Trains

This is real program design in miniature. You write a full sequence, predict its result, run it and debug it, which is the same loop programmers use. Spotting that “forward, forward, forward, forward” can be one loop is your first taste of making code shorter.

It also works spatial sense. After two left turns the robot faces backward, and you have to track that in your head.

Strategy Notes

  • Map the path before typing. Count squares and turns on the board, keeping in mind the robot must face its target.
  • Solve first, shorten later. Get any working program, then replay to swap repeats for loops and earn stars.
  • Park items to open routes. Dropping one on a free square can clear the way and save a long detour.
  • Slow the run to debug. The speed slider by the play button makes it easy to see which step breaks.
  • Track facing direction. Turns rotate in place, so note which way the robot points after each one.

Good to Know

Every command has an on-screen key, so a phone held upright works well, and you can also use a real keyboard. Sound effects can be muted. Robot Coder was made by Schnark for js13kGames 2018 and is released under the Apache-2.0 license.

Robot Coder questions and answers

Is Robot Coder good for kids who are new to coding?

It can be. Three tutorial levels introduce each command before the real puzzles start. There is no typing of code words, just arrow symbols and loops, so the challenge is the planning, not the syntax. Younger players may want a helper for the later groups.

What makes a run fail?

The robot stops with an error if it drives into a wall, item or target, tries to take from an empty square, drops something in the wrong place, or finishes with targets still waiting. A message names the problem.

How do I earn two stars?

Each level has a target program length. Matching it earns one star, and beating it earns two. Loops count toward the length too, so they pay off on long, repeating paths.

Are my results saved?

Yes. Your shortest solution for each level is kept in your browser, so you can come back later and try to shave a few more symbols off.

Games that use coding like Robot Coder

Different rules, same kind of thinking.

Try something from another shelf