Pseudocode help

A Robot Is Sitting In A Chair With Its Arms Facing Down.
make An Algorithm, Using Pseudocode, To Make The Robot:

  1. Stand Up
  2. Walk Forward Until It Senses A Wall
  3. Turn Around
  4. Walk Back To The Chair
  5. Sit Down In Its Original Starting Position

Finally, Output The Total Number Of Steps Taken.


In Addition To Our Standard Pseudocode Commands, You Must Also Use The Following Robot Control Commands:
Step (One Step Forward)
Raise Arms (Parallel To Floor)
Lower Arms (Pointing To Floor)
Sense (Only If Arms Are Raised)
Turn (90 Degrees Right)

Immediately After Issuing A Sense Command, You Can Check Whether The Robot Is At The Wall As Follows:

If At Wall
Or Alternatively
If Not At Wall


You Must Assume The Following Facts:
The Robot’s Initial Sitting Position Is Directly Facing The Target Wall.
There Are No Obstacles Between The Robot And The Wall.
The Wall Is 1 Or More Exact Steps From The Chair.
The Wall Is Sensed When It Is Less Than 1 Step From The Robot’s Arms.
The Length Of The Robot’s Arms Are Slightly Less Than The Length Of 1 Step.

Your Solution

Your Solution Must Include All Of The Following:
Adequate Comments
Initialization And Use Of At Least One Variable
Sequential Flow Of Control
Conditional Flow Of Control
Iterative Flow Of Control
Handling Of Any Special Cases
Output Of The Total Number Of Steps Taken

Hello! Do you have a specific question about this? We can’t just give answers away on the forums.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.