int main(int argc, char **argv) { if (argc > 2 || (argc == 2 && strcmp(argv[1], "print"))) { printf( "I expect no command line argument or \"print\" as unique command line argument.\n"); return EXIT_FAILURE; } if (!get_input()) { printf("Incorrect input.\n"); return EXIT_FAILURE; } convertMaze(); if (argc == 2) { drawMaze(); return EXIT_SUCCESS; } countGates(); countWalls(); countInAccAreas(); countAccAreas(); countCuldesacs(); countPaths(); outputResult(); return EXIT_SUCCESS; }
Maze * getMaze (void) { /*Pointer to the maze file*/ FILE * mazeFile = openFile("maze.txt"); /*Convert the maze file to a 2D array*/ Maze * maze = convertMaze(mazeFile); convertBinary(maze); return maze; }