Skip to Content

Karel the Robot in Scratch

A framework for implementing Karel the Robot programs in Scratch.

Karel the Robot is a programming environment for learning elementary programming developed by Richard E. Pattis (Karel The Robot: A Gentle Introduction to the Art of Programming. John Wiley & Sons, 1981). A simulator for Karel enables the learner to write programs that control the behavior of a robot on a graphics screen as it navigates around obstacles, and picks up and puts down "beepers". The Pascal-based programming language uses control structures and procedures (both predefined and user-defined), but, for simplicity, there are no variables or expressions.

These programs provide a framework for implementing Karel the Robot programs in Scratch. The correspondence is not precise, but the learner who knows Scratch can experience robot programming without learning a new programming language and environment. The small area of the Scratch stage and script area limit the size of the programs that can be written, but otherwise all Karel programs can be implemented with one exception (only one beeper can be placed on a corner).