Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C Programming. Write a prograrm that generates a random walk across a 10 10 array. The array will con- tain characters (all ' . '
C Programming.
Write a prograrm that generates a "random walk" across a 10 10 array. The array will con- tain characters (all ' . ' initially). The program must randomly "walk" from element to ele- ment, 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. Here's an example of the desired output: 9. BCD.. F E. H G KR S T U V Y N O Hint: Use the srand and rand functions (see deal.c) to generate random n After generating a number, look at its remainder when divided by 4. There are four possible values for the remainder-0, 1, 2, and 3-indicating 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 toStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started