Karel++
From Wikipedia, the free encyclopedia
Karel++ | |
---|---|
Paradigm | object-oriented |
Appeared in | 1990s |
Influenced by | Karel |
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.
Contents |
[edit] 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++.
[edit] Contrasting Karel the Robot with Karel++
[edit] Syntax and methodology
Karel the Robot, released in 1981, contains syntax and methodology deriving from Pascal; whereas Karel++ provides a basis for the logistics of C++ and Java. In Karel the Robot, the programmer is provided with the funamental problem solving medium, although in Karel++, the user has the ability to apply their problem solving skills with the construction of classes.
[edit] 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 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.
[edit] 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();
[edit] References
- Bergin, Joseph (1997) Karel++: A Gentle Introduction to the Art of Object-Oriented Programming, John Wiley & Sons, Inc. ISBN 0-471-13809-6
[edit] External links
- Karel++ Homepage - official homepage for Karel++
- Karel++ Info - provides Karel++ download for Windows