#ifndef MAZEGEN_H
#define MAZEGEN_H

/*****************************************************************************/
/* maze_generate() allocates memory for and generates a random maze of the   */
/* given width and height.                                                   */
/* The width and height must be odd integers no less than 3.                 */
/* The generated maze has two openings:                                      */
/*   one in the leftmost location of the top edge,                           */
/*   the other in the rightmost location of the bottom edge.                 */
/* For example, maze_generate(7,5) might look like this:                     */ 
/*      # #####             # #####                                          */
/*      #   # #             #   # #                                          */
/*      ### # #      or     # # # #                                          */
/*      #     #             # #   #                                          */
/*      ##### #             ##### #                                          */
/*                                                                           */
/* maze_generate() returns 0 if all is well                                  */
/* maze_generate() returns -1 and displays an error message to stdout if:    */
/* 1) there is not enough memory for the given maze size.                    */
/* 2) Either width or height is not odd or is < 3.                           */

extern int maze_generate(int width,int height);
/*****************************************************************************/



/*****************************************************************************/
/* maze_free() frees memory used by the maze.                                */
/* maze_free() should be called at the start of every call to maze_generate()*/
/* to free whatever memory was used to create the last maze.                 */
/* maze_free() should also be called before the program exits (as it is in   */
/* the test case) to ensure no memory leaks.                                 */

extern void maze_free();
/*****************************************************************************/



/*****************************************************************************/
/* maze_print() prints the maze to the standard terminal screen.             */
/* maze_print also displays the width and height of the maze in tiles.       */

extern void maze_print();
/*****************************************************************************/

#endif
