Karel (programming language)

Karel (programming language)

Infobox programming language
name = Karel the Robot

paradigm = object-oriented
year = 1981
designer = Richard E. Pattis
developer =
latest release version =
latest release date =
typing =
implementations =
dialects = Some localized language variants
influenced_by = Pascal
influenced = Karel++

Karel is an educational programming language for absolute beginners, created by Richard E. Pattis in his book "Karel The Robot: A Gentle Introduction to the Art of Programming". Pattis used the language in his courses at Stanford University. The language is named after Karel Čapek, a Czech writer who introduced the word "robot".

Principles

A program in Karel is used to control a simple robot (named Karel, of course) that lives in a city consisting of a rectangular grid of streets (left-right) and avenues (up-down). Karel understands five basic instructions: move (Karel moves by one square in the direction he is facing), turnleft (Karel turns 90 ° left), putbeeper (Karel puts a beeper on the square he is standing at), pickbeeper (Karel lifts a beeper off the square he is standing at), and turnoff (Karel switches himself off, the program ends). A programmer can create additional instructions by defining them in terms of those five basic, and using control flow statements if, while, iterate.

Example

The following is a simple example of Karel syntax (a ";" indicates that another instruction follows). BEGINNING-OF-PROGRAM DEFINE turnright AS BEGIN turnleft; turnleft; turnleft END BEGINNING-OF-EXECUTION ITERATE 3 TIMES turnright; move; turnoff END-OF-EXECUTION END-OF-PROGRAM

Variants and descendants

The language has inspired the development of various clones and similar educational languages. As the language is intended for beginners and children, localized variants exist in some languages, notably Czech (the programming language was quite popular in Czechoslovakia). The Slovak version, called Robot Karol++, contains further enhancements and it has been itself translated to English, German and Czech.

A direct Spanish translation of Karel is used as half the credit needed for selection into the [http://www.olimpiadadeinformatica.org.mx Mexican Olympiad in Informatics] .

The principles of Karel were updated to the object-oriented programming paradigm in a new programming language called Karel++. Karel++ is conceptually based on Karel, but uses a completely new syntax, similar to Java.

A language called Karel is a proprietary language used to program the robots of FANUC Robotics. However, FANUC Karel is derived from the Pascal programming language.

References

* Richard E. Pattis. "Karel The Robot: A Gentle Introduction to the Art of Programming". John Wiley & Sons, 1981. ISBN 0-471-59725-2.
* Joseph Bergin, Mark Stehlik, Jim Roberts, Richard E. Pattis. "Karel++: A Gentle Introduction to the Art of Object-Oriented Programming". John Wiley & Sons, 1996. ISBN 0-471-13809-6.

See also

Karel++ - object oriented Karel environment

Logo programming language - another educational programming environment

Guido van Robot - A tool based on Karel the Robot for learning Python

External links

* [http://mormegil.wz.cz/prog/karel/prog_doc.htm Karel syntax]
* [http://csis.pace.edu/~bergin/karel.html Karel++]
* [http://xkarel.sourceforge.net/ xKarel]


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • Educational programming language — An educational programming language is a programming language that is designed primarily as a learning instrument and not so much as a tool for writing real world application programs.ome examplesChildren* AgentSheets is an award winning game and …   Wikipedia

  • Karel — may refer to: * Karel (given name) * Karel (programming language), an educational programming language for absolute beginners * Charles Karel Bouley, on the air as Karel, San Francisco radio personalityIn surnames: * William Karel, French film… …   Wikipedia

  • Karel — (prénom) Cette page d’homonymie répertorie les différents sujets et articles partageant un même nom. Karel est un prénom mixte et un patronyme. C est un prénom dont la fréquence augmente en France, très usité notamment en Tchèquie. Sommaire 1… …   Wikipédia en Français

  • Karel (prenom) — Karel (prénom) Cette page d’homonymie répertorie les différents sujets et articles partageant un même nom. Karel est un prénom mixte et un patronyme. C est un prénom dont la fréquence augmente en France, très usité notamment en Tchèquie. Sommaire …   Wikipédia en Français

  • Karel++ — Infobox programming language name = Karel++ paradigm = object oriented year = 1990s designer = developer = latest release version = latest release date = typing = implementations = dialects = influenced by = Karel influenced = Karel++ is a… …   Wikipedia

  • Karel (given name) — Infobox Given Name Revised name = Karel imagesize= caption= pronunciation= gender = meaning = region = origin = related names = footnotes = Karel is a given name in Czech or Dutch, equivalent to Charles.Among the CzechsAmong the Czechs Karel… …   Wikipedia

  • Karel (prénom) — Cette page d’homonymie répertorie les différents sujets et articles partageant un même nom. Karel est un prénom mixte et un patronyme. C est un prénom dont la fréquence augmente en France, très usité notamment en Tchèquie. Sommaire 1 Sens et… …   Wikipédia en Français

  • Karel Čapek — Čapek redirects here. For other uses, see Čapek (disambiguation). The title of this article contains the character Č. Where it is unavailable or not desired, the name may be represented as Karel Capek. Karel Čapek …   Wikipedia

  • List of programming languages — Programming language lists Alphabetical Categorical Chronological Generational The aim of this list of programming languages is to include all notable programming languages in existence, both those in current use and historical ones, in… …   Wikipedia

  • Non-English-based programming languages — are computer programming languages that, unlike better known programming languages, do not use keywords taken from, or inspired by, the English vocabulary. Contents 1 Prevalence of English based programming languages 2 International programming… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”