Karel++

Karel++
Paradigm object-oriented
First appeared 1990s

Karel++ is a didactic object-oriented programming language designed solely as an introduction to preliminary, object-oriented programming. It is conceptually based upon a separate programming language called Karel.

Nomenclature

The Karel++ programming language was appropriately named after Czech writer, Karel Čapek (most commonly associated with contriving the common word, 'robot'). The 'plus plus' suffix of the title was presumably adapted from the popular object-oriented programming language, C++.

Contrasting Karel the Robot with Karel++

Syntax and methodology

Karel the Robot, released in 1981, contains syntax and methodology copied from Pascal; whereas Karel++ provides a basis for the logistics of C++ and Java. In Karel the Robot, the programmer is provided with the fundamental problem solving medium, although in Karel++, the user has the ability to apply their problem solving skills with the construction of classes.

Robot World

Because Karel++ is an OOP language, a virtual world is provided for the user in order to physically see their code application.

These robots inhabit a world lacking any sort of definite structure — it is simply a plain grid of horizontal "streets" and vertical "avenues" along which each robot can move. The map of each world is only capable of containing a set of walls and/or beepers. Beepers are items capable of manipulation granted the robot can lift these objects and place them in its beeper bag; walls are items incapable of any manipulation.

Example

An example of a Karel++ program when robot is located on (1, 2), facing east and holding 0 beepers (This code is intended to be placed within task{}):

   ur_Robot Karel(1, 2, East, 0);
   Karel.move();
   Karel.move();
   Karel.pickBeeper();
   Karel.move();
   Karel.turnLeft();
   Karel.move();
   Karel.move();
   Karel.putBeeper();
   Karel.move();
   Karel.turnOff();

References

External links