ภาคผนวกนี้กำหนดโครงสร้างของภาษาการเขียนโปรแกรม Karel ในหน้าเดียว
move()
turn_left()
put_beeper()
pick_beeper()
# Comments can be included in any part
# of a program. They start with a #
# and include the rest of the line.
def main() :
code to execute
declarations of other functions
front_is_clear()beepers_present()beepers_in_bag()left_is_clear()right_is_clear()facing_north()facing_south()facing_east()facing_west()front_is_blocked()
no_beepers_present()no_beepers_in_bag()left_is_blocked()right_is_blocked()not_facing_north()not_facing_south()not_facing_east()not_facing_west()if condition:
code run if condition passes
if condition:
code block for
"yes"else:
code block for "no"
for i in range( count):
code to repeat
while condition:
code to repeat
defname():
code in the body of the function.