Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Robot and the Wall Introduction to Pseudocode Your Name Goes Here.

Similar presentations


Presentation on theme: "The Robot and the Wall Introduction to Pseudocode Your Name Goes Here."— Presentation transcript:

1 The Robot and the Wall Introduction to Pseudocode Your Name Goes Here

2 The Problem A robot is sitting on a chair, facing a wall a short distance away. The robot can sense the wall with its fingertips but cannot see the wall or the chair. Your assignment is to instruct the robot to walk to the wall and return to its initial position. You are to express the required logic in pseudocode.

3 Robot Commands STAND SIT TURN (90 degrees) STEP ARMS UP ARMS DOWN ADD (Increment a counter) SUBTRACT (Decrement a counter) INITIALIZE (Zero a counter)

4 The First Attempt Arms Up Zero Counter DO WHILE fingers do not sense wall Step Add ENDDO Arms Down DO WHILE counter not equal to zero Step Subtract ENDDO Sit

5 The Solution


Download ppt "The Robot and the Wall Introduction to Pseudocode Your Name Goes Here."

Similar presentations


Ads by Google