Carnegie Mellon University

GridCity Project

GridCity Programming


Logo, Karel the Robot, Ootpik and GridCity

The idea of teaching a programming language using a robot-like environment is not new. In 1982, the Logo Laboratory at MIT completed a computer language called Logo, which ran on the Apple II computer [Papert, 1980]. This program allowed children to develop better thinking and problem-solving skills by writing their own programs to control a turtle on the computer screen.

In 1981, Richard Pattis released a book and programming environment for Karel the Robot [Pattis, 1981]. The language used by Pattis to control Karel's movements was very similar to the Pascal programming language. Many computer science courses adopted the use of this environment as a way to develop programming concepts within the Pascal-like environment before introducing students to Pascal itself.

In 1992, Henry Leitner, Stanley Eigen and Latanya Sweeney produced a robot environment similar to Karel's, but based on the syntax and constructs of C and then C++ rather than Pascal. The robot was named Ootpik and the system was used successfully for years at Harvard University. Subsequently, Pattis and others released a C++ version of Karel [Bergin et al., 1997] which replaced uses of Ootpik.

Our GridCity environment extends these ideas to the Java programming language which results in not only a change in syntax but also a means for introducing new ways for students to think about problem solving. In GridCity vehicles move around in a grid world in which they pickup and deliver parcels while avoiding collisions with other vehicles or crashing into walls. GridCity is implemented as a set of Java classes, so the students work directly in Java itself when writing GridCity programs. Taking advantage of the object-oriented programming paradigm of Java, a vehicle is a class and using inheritance, programmed behaviors can be used to specialize vehicles. Similarly, parcels can be specialized based on assignable attributes. Therefore, students can construct transportation systems, as an example, where certain kinds of vehicles, like bicycles and trucks, pickup and deliver specific kinds of parcels, like envelopes and boxes. Using Java thread support, students write programs to operate vehicles concurrently. Each vehicle can be programmed separately. This allows students to decompose problems into sub-programs for vehicles. Global knowledge can be shared using the grid itself. Alternatively, vehicles can rely on local knowledge and behave autonomously to achieve an overall global solution. We term this later kind of problem-solving, agent based programming.

In each of these simulations, students develop programming skills and learn programming concepts in an environment where program actions are explicitly visible. This is in sharp contrast to traditional computer programming where the actions of a program are typically not visible. However, a simulation does not assume the responsibility of instructing, but rather it makes it easier for instruction to take place. A student can play in any of these environments and certainly such play is beneficial and useful. However, playing in these simulators without supervision and structure cannot guarantee mastery of particular skills.

References

Papert, S. (1980) Mindstorms: children, computers, and powerful ideas. New York: Basic Books.

Pattis, R. (1981) Karel the Robot, A gentle introduction to the art of programming in Pascal. New York: Wiley.

Bergin, J., Stehlik, M., Roberts, J. and Pattis, R. (1997) Karel++, A gentle introduction to the art of object-oriented programming. New York: Wiley.


Summer 1999 GridCity, ActiveTutors [tutors@cs.heinz.cmu.edu]