For computer science teachers

Educational Robot simulator in Python

Robot is designed to teach programming fundamentals and helps develop algorithmic thinking. Students write small Python programs: they move the Robot across a grid, paint cells, and check for walls and already-painted cells. All of this is visible in the simulator window and runs locally.

Robot desktop window showing a colorful grid task with the robot, walls, and painted cells.
The Robot window: the field, walls, cells marked for painting, and the goal cell with a house.

Why Robot works well in class

Robot is aimed at school students who are just starting to program. Tasks are small problems on a clear field. Students write command sequences, loops, conditions, and functions while seeing the result of their code right away.

  • Clear tasks

    Walls, marked cells, and the goal cell are visible from the start, so it is easier for students to see what the program should do.

  • Automatic checking

    The result of the program is checked automatically. Students immediately see whether the solution passed and can fix the error themselves.

  • Multiple environments

    Many tasks include several environments. One program has to pass every variant, so students need to devise a general algorithm for the task.

  • Preview environments first

    Students can open each environment before writing code and see which cases their solution must handle.

  • Step-by-step execution

    Programs can run one command at a time in the Robot window. This is useful for debugging and for explaining a solution on a projector.

  • Constraints that match the lesson

    Some tasks limit commands or language constructs. The constraints help guide students toward the intended idea, such as a loop.

Robot window with task intro8: reach the house and paint marked cells along the way.
Task intro8: reach the house and paint every marked cell.

Students can see when it passes

When all environments are passed successfully, a message about it is displayed in the Robot simulator window. Students do not have to wait for the teacher to check their work.

Robot window with success state: all environments completed for task w45.

Look through environments before coding

The environment selector lets students inspect each field variant before they plan a solution that works everywhere.

Task w49 environment 1: different wall layout on the grid.
Environment 1
Task w49 environment 2: another wall layout requiring a general solution.
Environment 2

Step through the program

Step mode shows what each command does. It is useful for self-checking and for walking through a solution with the class.

Robot window in step mode: program paused after a move command.

Constraints are visible in the UI

If a task has constraints, they are displayed in the Robot simulator window next to the task condition. Students can see which tools they are expected to use.

Robot window showing task for26 with constraint hints in the UI.
Task with constraints
Constraint panel listing operator constraints and construct constraints for the task.
Constraint details

Browse Task Conditions

The separate task viewer opens the task catalog without running a student solution. A teacher can choose a topic, jump to a task number, read the condition, inspect every environment, and see the constraints. It is useful for lesson preparation and for showing a task on a projector.

What you can inspect

  • topic and task number;
  • task condition;
  • all task environments;
  • command and construct constraints;
Task viewer: task if3 with topic and number toolbar, condition text, and grid.
Task viewer (if3).

Using Robot in a lesson

After you introduce a topic, students work through tasks at their own pace. Automatic checking removes part of the routine review for teachers: you can see who needs help and who can already move on.

One possible lesson flow

  1. Introduce the topic: movement, loops, branching, or functions.
  2. Assign a task from the matching track, such as for12 or w25.
  3. Students run task("…") and improve their program until every environment passes.
  4. Use step mode to discuss tricky bugs or walk through a solution together.

Task tracks

Tasks are grouped by topic, so they can fit into an existing course plan.

Robot commands

You can import everything with from robot import * or import only the names you need.

Example

from robot import *

task("intro8")

move_down()
paint()
move_right()
paint()
move_up()
paint()
move_right()
paint()
move_down()

Choosing a task or creating a field

task("name")
Open a task from the bundled set.
field(width=8, height=6)
Open a Robot field without tying it to a task.

Action commands

move_right()
One cell right.
move_left()
One cell left.
move_up()
One cell up.
move_down()
One cell down.
paint()
Paint the current cell.
printn(value)
Print an integer in the current cell.

Environment analysis

is_free_left()is_free_down()
True if no wall in that direction.
is_wall_left()is_wall_down()
True if there is a wall.
is_cell_painted()
True if the cell is painted.
is_cell_not_painted()
True if not painted.
pol()
Pollution value in the current cell (integer).

Localization

Task conditions, the Robot simulator window, and help text are available in the languages listed below. The language is selected automatically based on the operating system's interface language.

Supported languages

  • English
  • Čeština
  • Deutsch
  • Español
  • Français
  • Italiano
  • Magyar
  • Nederlands
  • Polski
  • Português
  • Română
  • Svenska
  • Türkçe
  • Беларуская
  • Русский
  • Українська
  • Ελληνικά
  • العربية
  • اردو
  • हिन्दी
  • বাংলা
  • 简体中文
  • 繁體中文
  • 日本語
  • 한국어

Get started

  1. Download the module archive from GitHub Releases.
  2. Extract it into the student's working folder.
  3. Place the solution file next to the robot module. You can start from sample_solution.py in the archive.
  4. To choose another task, change the string passed to task(). The task names are listed in the tracks above.
  5. To browse task conditions without a solution, run viewer/viewer.py from the module archive.

Requirements: Python 3.7+ and the standard library. The Robot window uses tkinter. The tkinter module is included with most desktop Python installations.

Download the module GitHub