/********************************************************************* C201 Computer Programming II Fall 2006 Dana Vrajitoru & Testing the maze. **********************************************************************/ #include "maze.h" #include void main_loop(Maze & the_maze); int main(int argc, char **argv) { Maze the_maze; srand(time(NULL)); // If the program has a positional parameter, use it as the name of // the file. Otherwise use the default "maze.txt". if (argc > 1) the_maze.Read(argv[1]); else the_maze.Read("maze.txt"); the_maze.Random_player(); cout << the_maze; main_loop(the_maze); return 0; } // Function that reads an option from the user as a character and // performs an action based on it. void main_loop(Maze & the_maze) { char option = ' '; while (option != 'q' && option != 'Q') { cin >> option; the_maze.Move(option); cout << the_maze; } }