## Learning Python: Child's Play with RUR-PLE!

###### André Roberge, © 2005, 2006

### About RUR-PLE

Simply put, RUR-PLE is a Python Learning Environment. With the assistance of a robot named Reeborg, one can explore the fun of programming in the Python language. A standard Python interpreter is also included as well as an editor with a special "instant run" feature.

### A bit of history

The word "robot" entered our language through the 1920 play R.U.R. (Rossum's Universal Robots) by Czech writer Karel Capek. Little did Capek know how widespread the word robot would become!

Karel Capek's name became known in computer cicles in 1981, when Richard Pattis wrote a delightful little book titled Karel the Robot, a Gentle Introduction to the Art of Programming. In this book, Pattis introduces the main concepts of sequential programming (including loops and decisions, but not variable assignments) using the paradigm of instructing a robot capable of only four basic actions (turning left, moving one step forward, picking up and putting down beepers). Through the magic of programming, the robot learns to combine those four basic actions in order to accomplish tasks of increasing complexity. Pattis used Pascal, the preferred language of the day, as a means of "teaching" the robot new tricks. Since then, many new versions of Karel the Robot have appeared, used to introducing various computer languages, notably Java and C++, which are both based on the modern Object-Oriented Programming (OOP) approach.

However, since the complexity of Java and C++ contrasts with the simplicity of the robot world, these languages seem at odds with the idea of providing a Gentle Introduction to the Art of Programming.

Enter Python!... Named after the famous Monty Python's Flying Circus by its creator, Guido van Rossum. Python, like Java and C++, is an OOP language. However Python also allows a non-OOP programming style more suitable for interacting with Pattis's robot. A first implementation of Karel the Robot in Python was called PyKarel. The current implementation is called Guido van Robot (GvR for short), and is available at sourceforge.net.

RUR: a Python Learning Environment (RUR-PLE or Rur-ple or rur-ple) is a "new and improved" version of GvR that extends Pattis' ideas and allows a smooth transition to the use of variables as well as functions/methods, classes and objects. Rur-ple is a complete environment, its lessons cover the use of all of Python's keywords. A Python interpreter and simple editor are included to explore Python outside the robot's world.

Reeborg is a robot built on the 1981 Pattis' model ... and it is starting to show its age. It has an oil leak, which allows us to follow its trail. Its compass is broken; it only knows if it is facing north or not, unlike Karel or Guido who could determine their orientation with respect to all four cardinal points.

Pattis' Karel the Robot was named after the author Karel Capek, who popularized the word robot in his play Rossum's Universal Robots (RUR). While RUR-PLE shares the basic RUR acronym, in this case it stands for Roberge's Used Robot. However, through the magic of Guido van Rossum's Python, you can learn how to fix it and design a better one, worthy of the name Rossum's Universal Robot.