Question: Write a c program that generates a random walk across a 1 0 x 1 0 array. The array will contain characters ( all '
Write a c program that generates a "random walk" across a x array. The array will contain characters all initially The program must randomly "walk" from element to element, always going up down, left or right by one element. The elements visited by the program will be labeled with the letters A through Z in the order visited. Use the srand and rand functions see deal.c to generate random numbers. After generating a number, look at its remainder when divided by There are four possible values for the remainder and indiciating the direction of the next move. Before performing a move, check that a it won't go outside the array, and b it doesn't take us to an element that already has a letter assigned. If either condition is violated, try moving in another direction. If all four directions are blocked, thr program must terminate. After Z the letters should start over again at A
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
