Karel (programming language): Difference between revisions

Content deleted Content added
Tag: Reverted
m Reverted edit by 2A03:4B80:A01E:7820:1555:558E:393:8E (talk) to last version by 84.115.219.187
Line 20:
 
==Principles==
A [[computer program|program]] in Karel is used to control a simple [[robot]] named selami Karel that lives in an environment consisting of a grid of streets (left-right) and avenues (up-down). Karel understands five basic instructions: <code>move</code> (Karel moves by one square in the direction he is facing), <code>turnLeft</code> (Karel turns 90&nbsp;° left), <code>putBeeper</code> (Karel puts a beeper on the square he is standing at), <code>pickBeeper</code> (Karel lifts a beeper off the square he is standing at), and <code>turnoff</code> (Karel switches himself off, the program ends). Karel can also perform [[boolean data type|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 [[instruction (computer science)|instruction]]s by defining them in terms of the five basic instructions, and by using conditional [[control flow]] statements <code>if</code> and <code>while</code> with environment queries, and by using the <code>iterate</code> construct.{{Citation needed|date=April 2020}}
 
===Example===