Question
No. 1:
Write an algorithm for ‘Person 1, looking at Person 2 with
eyes closed, directs Person 2 through obstacle
Solution:
We are assuming Right Priority. Furthermore, constructing a
function for person 1 walking towards goal through obstacles and after that
person 2 follows person 1 upon call.
Algorithm:
Person 1 walks through Obstacles
Person 1 looking to goal
[
Move forward
%% Obstacle detected
Stop;
Rotate 90
degrees right
Follow
obstacle
Direct
towards goal
%% Obstacle detected
Stop
Rotate 90
degrees right
Follow
obstacle
Direct
towards goal
Reach goal
]
End
Person 1 call person 2
[
Person 1
walks through obstacles
]
End
Question 2:
Write an
algorithm for person 1 looking an object, guides person 2 whose eyes are closed
to grab an obstacle
Solution:
Algorithm:
Person 1
calls person 2
[
Move forward
%% Obstacle detected
Stop
Rotate 90
degrees right
Follow
obstacle
Directs
towards goal/Object
Pick up the
object
]
End
Question 3: