Question: adjust this c program #include #include / * srand ( ) , rand ( ) * / #include / * time ( ) * /
adjust this c program
#include
#include srand rand
#include time
int mainvoid
char letter A
grid;
int i
j
up directions are essentially bools, written as ints to
down conform with C standard.
left
right
move ;
srandunsigned timeNULL;
gridij letter;
while letter Z
up down left right move ;
if j && gridij
up ;
if j && gridij
down ;
if i && gridi j
right ;
if i && gridi j
left ;
if up down left right
break;
move rand;
Intentional fallthrough if direction fails
switchmove
case :
if up
gridij letter;
break;
case :
if down
gridij letter;
break;
case :
if right
gridij letter;
break;
case :
if left
gridij letter;
break;
default:
break;
for i ; i ; i
for j ; j ; j
if gridij
gridij;
printfc gridij;
printf
;
return ;
Rather than stopping at Z adjust the program so it continues until the path is blocked. 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
