Please help write a program for this in C. Level 1: The Mouse Discovers At Level
ID: 658148 • Letter: P
Question
Please help write a program for this in C.
Level 1: The Mouse Discovers At Level 1, the Display only shows a ''template'' maze; with only the outside borders, the posts, and the start cell walls visible (from the file maze.template). However, the Display does keep track of the full configuration of the maze from the file maze.dat and provides functions for the simulator to access cell walls for a given coordinate and to draw walls on the screen at a given coordinate. The user at Level 1 has the same movement commands as in Level 0, as well as the additional commands: r -- move one cell as a right wall hugger l -- move one cell as a left wall hugger m -- show the full maze (cheat) to let the mouse discover the maze as either a left or right wall hugger, on e step at a time. In addition, Level 1 provides a ''cheat'' command to reveal the full configuration of walls in the maze. The simulator will keep track of the mouse's position in the maze as in Level 0, and also adds a count of how many cells the mouse has visited since leaving the start square (including revisted cells). In addition, the user has a ''Mouse Cam'' at LEVEL 1, displayed under the control of the simulator using a function in the Display. The Mouse Cam shows the mouse's view of the walls on its left, front and right sides. At Level 1, the simulator should also detect crashes into walls (hopefully only occurring when the mouse is driven by the user), and allows the user to restart at the start square.Explanation / Answer
event for mouse discover the maze either a left or right wall hugger-
void init_dis(int position);
void sh_mouse(int direction, int r, int c);
void wri_message(char str[], int l);
void clr_scr(void);
void sh_position(int a, int b);
void sh_cel(int cel);
void sh_uni_cel(int cel);
void mouse_maze(int L, int front, int R);
void levl0_get_wall(int a, int b, int *N, int *Ea, int *W, int *S);
void put_wall(int a, int b, int N, int E, int W, int S);