Roles of Variables Home Page

Download PlanAni —
A Role-based Program Animator

See a video:

PlanAni is a program animator based on the idea on roles of variables. In PlanaAni, each role has a visualization—role image—that is used for all variables of the role. Role images give clues on how the successive values of the variable relate to each other and to other variables. For example, a fixed value is depicted by a stone giving the impression of a value that is not easy to change, and a most-wanted holder by flowers of different colors: a bright one for the current value, i.e., the best found so far, and a gray one for the previous, i.e., the next best, value.

PlanAni utilizes role-based animation of various operations like assignment and comparison. For example, consider the comparison "some_variable > 0". In case (a) below, the variable is a most-recent holder and the comparison just checks whether the value is in the allowed range. In the visualization, the set of possible values emerges, allowed values with a green background and disallowed values with red. The arrow that points to that part of the values where the variable lays, appears as green or red depending on the values it points to. In case (b), the variable is a stepper and, again, the allowed and disallowed values are colored. However, these values are now part of the variable visualization and no new values do appear.

In the current implementation, animation commands must be authored by hand for each program to be animated. Typically five animation lines are required for each line in the animated program. There are ready-made animations for five Java, C, Python, and Pascal programs—four that are suitable for teaching elementary programming, and one that demonstrates the animation of various roles. These programs can be easily turned into, e.g., C++, and new programs can be added with a modest effort.

Suggested ways to use roles and PlanAni in teaching elementary programming are described here.

Simple Download for Windows

The following distribution file contains PlanAni and Tcl/Tk (as a single executable file from, and a batch file to run PlanAni:

Unpack the distribution file and run PlanAni by double cliking run_PlanAni.bat.

(October 15, 2007: The simple download works now on Windows Vista, too.)

Download (Windows, Linux/UNIX, Mac)

PlanAni is implemented using Tcl/Tk and it has been tested both on Linux/Unix and Windows NT (and should run without problems on Mac, too, but this has not been tested.)

You must have Tcl/Tk installed in order to run PlanAni. On many Linux/UNIX distributions, Tcl/Tk is installed automatically. To test if your Linux/UNIX has Tcl/Tk, enter "which wish" on command line. If the answer is a file name, e.g., "/usr/local/bin/wish", then you have Tcl/Tk already installed.

Tcl/Tk can be freely downloaded from

The current version of PlanAni can be downloaded here:

Unpack the distribution file and run PlanAni as follows:

A Note on Broken Arrows

On some platforms, arrows pointing at variables break at the border delimiting the code and variable areas:

This can be corrected by inserting a small extra area on top of the variable area as follows: find the comment "#Canvas for varibles" [sic] in the file src/GBI/GBI.tcl and add the following two lines in front of the comment:

    canvas -background white -width 250 -height 6     
    pack  -side top -expand false -fill x 
The height option can now be tweaked to make arrows look proper.

PlanAni Documentation

The doc directory contains more information on using PlanAni: The file help.txt contains a short user guide for end users of PlanAni (i.e., students), the file userGuide contains instructions for authoring new animations, the file API describes how animation commands work, and the directory man/mann contains manual pages for API commands.

Version Information

We are currently revising the AN interface, so that you have to revise your own examples if they are made to work with the versions up to 0.55.

(Earlier PlanAni versions can be downloaded here.)

Last updated: February 23, 2011