adding cs235

This commit is contained in:
dm
2016-04-06 20:46:10 -07:00
parent 8e52ce1982
commit cf99ec6565
178 changed files with 13079 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
#include <stdio.h>
#include <cassert>
#include <stdlib.h>
#include <time.h>
#include "maze.h"
int main(int argc, char * argv[]) {
srand (time(NULL));
maze m;
m.createRandomMaze();
bool b;
if (argc == 2) {
b = m.importMaze(argv[1]);
}
else {
b = m.importMaze("Mazes/test1.txt");
}
if (b) {
cout << "success" << endl;
}
else {
cout << "failure" << endl;
}
m.importMaze("Mazes/maze_sample.txt");
assert(m.traverseMaze());
cout << m << endl;
m.importMaze("Mazes/solvableMaze.txt");
assert(m.traverseMaze());
cout << m << endl;
cout << m.getMazePath() << endl;
cout << "first" << endl;
m.importMaze("Mazes/solvableMaze2.txt");
assert(m.traverseMaze());
cout << m.getMazePath() << endl;
cout << "second" << endl;
m.importMaze("Mazes/badMaze1.txt");
assert(!m.traverseMaze());
m.importMaze("Mazes/badMaze2.txt");
assert(!m.traverseMaze());
m.importMaze("Mazes/badMaze2.txt");
assert(!m.traverseMaze());
m.importMaze("Mazes/maze_sample.txt");
}