Question: You can use the following code to determine which direction the robot will move at each step. srand ( time ( 0 ) ) ;
You can use the following code to determine which direction the robot will move at each step.
srandtime;
int direct;
direct rand; random number between and so each is probable
means North, means South, means East and means West
The robot moves times. At each step, how many blocks away print this in north or south, east or west of the starting point is the robot from the starting point?
You want the robot to get to a point that is blocks to the east and blocks to the north of the starting point. Given the same random choices for moves, change your code so that your code prints out how many steps it took to get to the destination point.
the language is c
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
