/***************************************** 
** File: maze.c
** Author: Marie desJardins
** Date: 10/31/06
** E-Mail: mariedj@cs.umbc.edu 
** 
** Program to search a maze recursively.
** Usage:  a.out MAZE_FILE -- read an input maze file, find a route
**   through the maze, and print the solution to the terminal.
*****************************************/ 

#include <stdio.h>
#include <stdlib.h>
#include "amazing.h"
#include "2darray.h"

int main (int argc, char *argv[]) {
  MAZE maze;

  if ( argc != 2 ) {
    fprintf (stderr, "Usage: a.out MAZEFILE\n");
    exit (-1);
  }

  ReadMaze (argv[1], &maze);
  if ( SolveMaze(&maze, maze.srow, maze.scol) ) {
    printf ("Success!\n");
    PrintMaze (maze.board, maze.rows, maze.cols);
  } else {
    printf ("Boo-hoo -- I couldn't find a path through the maze!\n");
  }

  return 0;
}

