Question: Homework R Write a function that takes as inputs a robot location and a terrain Map. The Map is a grid like the one from

 Homework R Write a function that takes as inputs a robot

Homework R Write a function that takes as inputs a robot location and a terrain Map. The Map is a grid like the one from activity 3 and each cell has a number associated with a terrain type (0-asphalt, 1-grass, 2-sand). Your function should return a string associated to the gait to be employed by the robot e.g., slow, medium, fast. void getGait (int x, int y, int *terrainMap, char* gaitSpeed) Wite a second function getLocalTerrain, which takes as inputs the current x,y robot location and the terrain map. The function should return the predominant terrain surrounding the robot. That is you need to look at all neighboring cells (N,S,E,W when applicable) and select the terrain that shows up the most. If there are ties, choose the worst terrain type. int getLocalTerrain(int x, int y, int *terrainMap) BVML3811 Homework R Write a function that takes as inputs a robot location and a terrain Map. The Map is a grid like the one from activity 3 and each cell has a number associated with a terrain type (0-asphalt, 1-grass, 2-sand). Your function should return a string associated to the gait to be employed by the robot e.g., slow, medium, fast. void getGait (int x, int y, int *terrainMap, char* gaitSpeed) Wite a second function getLocalTerrain, which takes as inputs the current x,y robot location and the terrain map. The function should return the predominant terrain surrounding the robot. That is you need to look at all neighboring cells (N,S,E,W when applicable) and select the terrain that shows up the most. If there are ties, choose the worst terrain type. int getLocalTerrain(int x, int y, int *terrainMap) BVML3811

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!