Principles
A program in Karel is used to control a simple robot named Karel that lives in an environment consisting of a 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). Karel can also perform boolean queries about his immediate environment, asking whether there is a beeper where he is standing, whether there are barriers next to him, and about the direction he is facing. A programmer can create additional instructions by defining them in terms of the five basic instructions, and by using conditional control flow statements if and while with environment queries, and by using the iterate construct.
Read more about this topic: Karel (programming Language)
Famous quotes containing the word principles:
“I have ever deemed it fundamental for the United States never to take active part in the quarrels of Europe. Their political interests are entirely distinct from ours. Their mutual jealousies, their balance of power, their complicated alliances, their forms and principles of government, are all foreign to us. They are nations of eternal war.”
—Thomas Jefferson (17431826)
“Unless democracy is to commit suicide by consenting to its own destruction, it will have to find some formidable answer to those who come to it saying: I demand from you in the name of your principles the rights which I shall deny to you later in the name of my principles.”
—Walter Lippmann (18891974)
“Now there cannot be first principles for men, unless the Divinity has revealed them; all the restbeginning, middle, and endis nothing but dreams and smoke.”
—Michel de Montaigne (15331592)