The cT Programming Language Archives
[VPython home page]
Brief history of cT
The cT programming language was developed in the period 1985-2000 in the Center
for Design of Educational Computing at Carnegie Mellon University in Pittsburgh
(the Center was later renamed the Center for Innovation in Learning; it ceased
operation in 2002). The developers were David Andersen, Bruce Sherwood, Judith
Sherwood, and Kevin Whitley. The initial impetus was the need for an easy to
use graphics- and mouse-oriented programming environment for faculty and students
using the then-new "3M" Unix workstations (a million bytes of memory,
a million pixels, and a million instruction per second).
Ease of use was important because the alternative, writing in C and using highly
complex graphics libraries, was beyond the capabilities of most users. Another
issue was that at that time the windowing software was changing rapidly, so
that programs written in C that used graphics or the mouse quickly became obsolete.
Moreover, it soon became clear that not everyone would use Unix workstations,
thanks to the increasing capabilities of the popular microcomputers, especially
Macintosh and IBM PC. This put a premium on cross-platform executability of
graphics programs, which C did not offer but cT did.
cT was based on earlier languages used by the authors of computer-based educational
materials written for the PLATO computer-based education system developed at
the University of Illinois at Urbana-Champaign. cT is a granddaughter of the
TUTOR language initiated in 1967, and a daughter of the MicroTutor language
initiated in 1977. cT differs from the earlier dialects in being designed for
the modern graphical user interface (windows and mouse). Here is a reproduction
of the textbook The TUTOR Language written
in 1977 by Bruce Sherwood.
cT was used for a variety of purposes, but its main niche was the creation
of programs for education. Many prize-winning educational programs were written
in cT, especially in the area of physics.
In the fall of 1997 Ruth Chabay and Bruce Sherwood taught cT to students in
an introductory physics class at Carnegie Mellon, and students used cT to model
physical systems with graphical animations of system behavior. Thanks to its
ease of use, it was possible in a mere hour or two to teach an adequate subset
of cT to students for the purposes of the physics course, even for the many
students who had never written a computer program before.
This approach was repeated in the fall of 1998. In the course was a freshman
computer science student named David Scherer. In the following year he was looking
for an interesting project to work on and proposed creating an alternative programming
environment for students to use in the physics course. His hope was to make
the programming even easier for novices, yet make it feasible for them to create
real-time navigable 3D animations, whereas cT offered only 2D graphics. Assisted
by David Andersen, Ruth Chabay, Ari Heitner, Ian Peters, and Bruce Sherwood,
in the spring and summer of 2000 Scherer produced the VPython programming environment
which was deployed in the fall 2000 physics course. The clear superiority of
VPython with its easy to use object-oriented 3D graphics led to the decision
to stop development of cT and concentrate on VPython.
Archived here are versions of the cT programming environment for Windows, Macintosh,
and Linux, plus the public-domain source code for these environments. No support
is currently available for these materials, but you are free to do whatever
you like with them.
glowscript.org A 3D programming environment similar to VPython, but runs in a browser
on the physics curriculum
Translated into Serbo-Croatian by Jovana Milutinovich
Translated into Russian by Ivanka Skakun
Later translation into Russian by Olga Fedorova
Translation into Belarussian by Vicky Rotarova
Translation into Ukrainian by Milana Sharapova
Translation into Polish by Coupon machine Team
Translation into Lithuanian by Sergey Ivanov
Translation into Greek by Nikolaos Zinas
Translation into Macedonian by Katerina Nestiv
Translation into Indonesian by Jordan Silasen
Translation into Romanian by Irina Vasilescu
Translation into Thai by Ashna Bhatt
Translation into Uzbek by Sherali Niyazova
Translation into Georgian by Ana Mirilashvili
Translation into Spanish by Augusto Dueñas
Overview of cT
You should not start using cT now, because it is no longer
supported. See vpython.org instead. The following materials are made available as an archive with historical
The cT programming language is an algorithmic language like C, Pascal, Fortran,
and Basic, but greatly enhanced by multimedia capabilities, including easy-to-use
support for color graphics, mouse interactions, and even movies in QuickTime
or Video for Windows format.
The cT programming language offers easy
programmability of multimedia programs,
portability across Macintosh, Windows, Linux, and
The cT programming environment offers
on-line help with executable program examples,
graphics editor for automatic generation of graphics
incremental compiling to provide rapid
detailed error diagnosis.
cT was developed in the Center for Innovation in Learning at Carnegie Mellon
University in Pittsburgh by David Andersen, Bruce Sherwood, Judith Sherwood,
and Kevin Whitley. cT is a trademark of Carnegie Mellon University.
- When is (was) cT the right tool?
- Major features of the cT language
- Major features of the cT programming
- Obtaining cT at no cost
- Sample Programs Included with cT
- cT References
When is (was) cT the right tool?
It would not be prudent to start using cT now, when it is no longer being
supported. The following materials are made available as an archive with historical
There are many excellent applications available for creating pictures and diagrams,
and for making multimedia presentations, without having to write your own computer
However, it is sometimes the case that doing something really new and different
is hard to do with these non-programming applications, because they often don't
provide enough control of interactions and enough calculational capability to
do what you really want to do.
cT offers the open-ended flexibility and power associated with programming languages
but eliminates many of the difficulties and complexities usually associated
with using a programming language.
Major features of the cT
- interactive graphics in windowed environments
- instant portability across Macintosh, Windows, Linux, and Unix
- support for QuickTime and Video for Windows
- animation of bitmap images
- color support for palette color and true color
- built-in support for buttons, sliders, and scrolling text panels
- multi-font text and character-string variables
- "hot" text (for hypertext applications)
- pull-down menus
- mouse and keyset inputs
- optional rescaling of text and graphics to fit the window
- analysis of words and sentences
- analysis of numbers and algebraic expressions
- rich sequencing options
- standard calculational capabilities
- numeric and text files
Major features of the cT programming
- integrated editing and execution environment
- incremental compilation for fast revision and execution
- on-line reference manual with executable examples
- graphics editor which generates cT graphics statements
- accurate and informative error diagnostics
- an extensive suite of sample programs in source form
Download cT 3.0 at no cost for Windows, Macintosh, or Linux:
Click here to view the license agreement and download cT.
Programs written in cT run compatibly on
all these machines, with no changes required. All that is needed is to transfer
the file and compile it.
cT formerly was distributed by Physics Academic Software, whom we thank for
their professional work on behalf of cT. Vastly expanded use of the World Wide
Web has made it now appropriate to try a network distribution mechanism.
Sample Programs Included with cT 3.0
Here are descriptions of the cT programs available from the cT download page
to give you ideas for your own work:
- sample -- This program is a sampler of many of the basic
capabilities of cT: color graphics, animations, pull-down menus, mouse clicks
and drags, multi-font text, "hot" text, calculations, graphing of functions,
and response analysis. After running the program you might want to study the
program code to see how the effects are achieved.
- exercise -- A set of exercises to help you learn the basic concepts
of programming in cT. The program contains a number of incomplete units with
suggestions on how to complete them. The cT help contains the information
needed to do these exercises.
- editfile -- A more complex version of the example discussed in "A
File Editor Application". The editfile.t version reads and writes styled files
containing multiple sections (that is, created with multiple dataout-s).
- showicon -- A program that displays the icons in an icon file. This
can be useful in selecting icon numbers for use in a plot, move, cursor, or
- icon -- A program for designing icons, cursors, and patterns,
except on the Macintosh, for which the program Icon Maker is supplied.
- japan -- This program displays Japanese "Kanji" characters, using a
set of icons "KANJI18.FCT".
- draw -- A basic drawing editor, with many of the features of
commercial drawing editors, such as grouping objects together, applying
patterns, colors, and arrowheads, and designing your own palette of colors.
Drawings are saved in the form of cT source code, so you may find draw.t
useful in creating portions of your own programs, including color palette
commands. This program also illustrates one approach to "object-oriented"
programming in cT.
- map -- A little program which displays a map of the 48 contiguous
states of the United States, with an ability to zoom in and out.
- palette -- A use file which provides a set of useful additional
colors beyond the basic eight cT colors, including dark red, dark green, and
light, regular, and dark versions of slate, teal, coral, gray, gold, lavender,
- setcolor -- A use file which lets you experiment with the color of
an object, in the full context of your running program. This is useful for
deciding exactly what color the object should be in relationship to other
elements of your display.
- chaos -- A plot of the chaos in a simple population growth scheme.
Usually what is plotted is just the final-state population. This program uses
hues from blue to red to show the approach to the final state. The red dots
correspond to the usual plot.
- spiro -- Make geometrical color designs by choosing the total
number of vertices and the number of vertices to skip. It uses the use-file
- video -- A program which gives an example of how to build your own
special-purpose video controller, using the basic video commands. This file
can be used as a use file by other programs. A short video clip for testing
purposes is provided for Macintosh and Windows.
- BigForty -- A solitaire card game which uses touch regions, so that
event-handling routines are driven automatically; there are no pause commands
in the program. The program uses the use file animate to provide the option of
sliding cards smoothly over the background on sufficiently fast computers.
- rilato -- A Mah Jong-like game in which you match corresponding
pairs of tiles. Pairs can be chemical elements and their symbols, American
presidents and their years in office, English kings and their years of reign,
or American states and their capital cities. You can also create your own
lists of pairs.
Physics and Math
- grapher -- Solves and graphs systems of algebraic or ordinary
differential equations. This program was a first prize winner in the 1990
Educational Software Contest of the journal Computers in Physics
(Sept./Oct. 1990, p. 540). The program includes an interactive explanation of
how to use the program.
- hill -- Draw a hill with the mouse, place a block on the hill, give
it an initial speed, and watch it move. If there is a valley, the block may
move back and forth forever (no friction), or slowly come to rest (if you add
some friction with the slider control). While the block moves, bar graphs
display the kinetic, potential, and total energy. At the beginning of the
program, the program makes a measurement to determine the animation step size,
so the animation runs at about the same speed on fast and slow computers.
- orbit -- Launch a satellite near two stationary "earths," and watch
the unusual orbits that result. At the end of the file is a 4th-order
Runge-Kutta numerical integration procedure which may be useful in other
- optics -- Place lens and mirrors along a bench, then flash a light.
Rays spread out and are bent by the optical elements, producing a spot on a
piece of film. There is an interactive explanation of how to use the program.
- quantumw -- Study the quantum behavior of an electron in various
kinds of potential wells. If the well is symmetrical, the bound states have
symmetrical wave functions.
- sonar and voltage -- Simple examples of
microcomputer-based-laboratory software. Connect a Universal Lab Interface
(ULI) and Sonic Ranger (distributed by Vernier Software of Portland, Oregon,
phone 503-297-5317) to the serial port of either a Macintosh or an MS-DOS
machine, and sonar will track your motion in front of the motion
detector. If you don't have this equipment, use the mouse to make motions that
are graphed on the screen. The program voltage uses the ULI to plot
voltage as a function of time.
- xyplot -- Plot a function of two variables, f(x,y), using a set of
icons of differing dot densities (icon file random).
Inter-computer programs using sockets
- InterDraw -- Run this program on two different Macintoshes in the
same AppleTalk zone, or two different Unix workstations on the same network
(provided that a cT server has been established), and two people can draw on
each other's screens, or run two copies of the program on one Unix
workstation. This program is a simple example of the use of the socket command
to link separate programs together.
- Battleship -- The classic "battleship" game played on two different
Macintoshes in the same AppleTalk zone, or two networked Unix workstations
(provided that a cT server has been established). This is another example of
the use of the socket command. It also provides another example of how to do
object-oriented programming in cT. The program uses the icons file SHIPicn.
- The March/April 1993 issue of the journal "Computers in Physics" (p. 136)
contains an article by Bruce Sherwood and David Andersen describing cT and
various applications written in cT.
- A discussion of some of the issues related to machine independence may be
found in an article by David Andersen and Bruce Sherwood in the November 1991
issue of Byte Magazine (p. 221).
[VPython home page]