Flowchart Problem
A robot is sitting down. There is a wall at an unknown distance in front of him. The task
is to flowchart the sequence of steps (the process) that the robot must execute to do the
following:
• To touch the wall
• To return to the same position he was when he started the task.
Background
When the robot is sitting down, and his arms are raised his fingertips are aligned with the
tips of his shoes. The only way the robot can sense that he has touched the wall is with
his fingertips. The robot can only understand one instruction at a time. Again, the task is
for the robot to find the wall and then return to the same position he was in when he
started the task. At the beginning and end, the robot is sitting down with his arms at his side.
Robot Instructions
The robot understands the following instructions:
• Standup
• Sit Down
• Take step (only can take one step at a time)
• Raise arms
• Lower arms
• Turn right (only can make 90-degree turns)
The robot can perform the following arithmetic:
• Add one
• Subtract one
• Record total
The robot can answer the following questions (logic)
• Touch wall?
• Are the results positive?
• Are the results negative?
• Are the results zero?