Question: Need help coding in C for this Maze Runner Project First Section of Code = mazelib.h Second Section of Code = Mazerunner.c Third Section of

Need help coding in C for this Maze Runner Project

First Section of Code = mazelib.h

Second Section of Code = Mazerunner.c

Third Section of Code = mazelib.c

Need help coding in C for this Maze Runner Project First Section

of Code = mazelib.h Second Section of Code = Mazerunner.c Third Section

of Code = mazelib.c #include #include #include #include #include "mazelib.h" static void

set_offsets_for_dir(int*, int*, direction); static void shuffle_dirs(direction*); static int xy_to_index(int, int); static void

#include  #include  #include  #include  #include "mazelib.h" static void set_offsets_for_dir(int*, int*, direction); static void shuffle_dirs(direction*); static int xy_to_index(int, int); static void reset(void); static bool are_valid_maze_dimensions(int, int); static void set_offsets_for_dir(int*, int*, direction); static void maze_visit(int, int); static int width; static int height; static char *maze; static bool initializing = false; // maze_init allocates the memory for the maze array based on width and height bool maze_init(int w, int h) { if(!are_valid_maze_dimensions(w, h)) { return false; } width = w; height = h; srand(time(NULL)); maze = malloc(sizeof(*maze) * width * height); reset(); initializing = true; maze_visit(1, 1); maze_set_char(1, 1, 'S'); maze_set_char(width-2, height-2, 'E'); initializing = false; return true; } int maze_get_width(void) { return width; } int maze_get_height(void) { return height; } // returns "true" if x and y are both in-bounds defined by: // 0  8 && h > 8 && w   Project 3 Maze Runner Due: 10th October 2017 Overview In this roject we will revisit the logic of maze solving fromearlier in the course, this time providing an actual C implementation to solve the proble In the course of this project, you will get more practice with all of the fundamental programmatic struc tures of C as well as experience using etera bry code. Finally; you wil need to create your first real h file so that your code can be interfaced with externally submission instr uctions Subit only the c and h files that you created along with your Makefile, b do not zip them! Additionally, be sure your makefile produces an executable called "maze runr"s that my test script can rum it Technical Description and Instructions In this project, you will not write a full program. I have already written most of a program to solve randomly generated mazes. The parts that I have written generate the maze and provide functions through which the maze can be interacted with. Additionally, the parts that I have written rely on calling some fuctions that will solve the mze. Implementing those functions is your job! Your Two Files You must create two files for this projet: "u and rumnerh" Runer "h" should expose two functions to the rest of the program called runnersolnd runner _init). The first function will utilize the maze library functions I've provided to solve a mazel. The cond function simply performs any setup necessry for the runner solve function to r These two fis should be implemnted n the runmer.c" file You may create as many helper functions as necsary to support your runner-solve() function". Likewise, you may us any reasonable algorithm to actually solve the maze. Your r mst leave behind a trail of breadcrumbs as moves through the maze see ? for details). Program Output Program output is actually handled for vou on thin! The maz runerc fileve provided for you will call print maze) for you to show both the unsolved maze and the maze after your runner has finished. However, you must accurately show the path that was taken by your algoritm to solve the z. This is done by using the maze set char ) function as your rroves through the maze. When the ner crosses an empty square, it should leave a ,,' behind, when it crosses a ,.. it should leave an ,o' behind Descriptions of these maze Ebrary functions are in the comments of the mazelib.h file provided My implementa tion has around five  Project 3 Maze Runner Due: 10th October 2017 Overview In this roject we will revisit the logic of maze solving fromearlier in the course, this time providing an actual C implementation to solve the proble In the course of this project, you will get more practice with all of the fundamental programmatic struc tures of C as well as experience using etera bry code. Finally; you wil need to create your first real h file so that your code can be interfaced with externally submission instr uctions Subit only the c and h files that you created along with your Makefile, b do not zip them! Additionally, be sure your makefile produces an executable called "maze runr"s that my test script can rum it Technical Description and Instructions In this project, you will not write a full program. I have already written most of a program to solve randomly generated mazes. The parts that I have written generate the maze and provide functions through which the maze can be interacted with. Additionally, the parts that I have written rely on calling some fuctions that will solve the mze. Implementing those functions is your job! Your Two Files You must create two files for this projet: "u and rumnerh" Runer "h" should expose two functions to the rest of the program called runnersolnd runner _init). The first function will utilize the maze library functions I've provided to solve a mazel. The cond function simply performs any setup necessry for the runner solve function to r These two fis should be implemnted n the runmer.c" file You may create as many helper functions as necsary to support your runner-solve() function". Likewise, you may us any reasonable algorithm to actually solve the maze. Your r mst leave behind a trail of breadcrumbs as moves through the maze see ? for details). Program Output Program output is actually handled for vou on thin! The maz runerc fileve provided for you will call print maze) for you to show both the unsolved maze and the maze after your runner has finished. However, you must accurately show the path that was taken by your algoritm to solve the z. This is done by using the maze set char ) function as your rroves through the maze. When the ner crosses an empty square, it should leave a ,,' behind, when it crosses a ,.. it should leave an ,o' behind Descriptions of these maze Ebrary functions are in the comments of the mazelib.h file provided My implementa tion has around five

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!