Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a13edeecde | |||
| 26db262281 | |||
| bc177fe5ce |
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
.gitattributes export-ignore
|
||||||
|
.gitignore export-ignore
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
|
.cache
|
||||||
CMakeCache.txt
|
CMakeCache.txt
|
||||||
CMakeFiles
|
CMakeFiles
|
||||||
CPackConfig.cmake
|
CPackConfig.cmake
|
||||||
@@ -5,6 +6,7 @@ CPackSourceConfig.cmake
|
|||||||
Makefile
|
Makefile
|
||||||
_CPack_Packages
|
_CPack_Packages
|
||||||
cmake_install.cmake
|
cmake_install.cmake
|
||||||
|
compile_commands.json
|
||||||
config.h
|
config.h
|
||||||
install_manifest.txt
|
install_manifest.txt
|
||||||
mazemaker
|
mazemaker
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
cmake_minimum_required (VERSION 3.0)
|
cmake_minimum_required (VERSION 3.0)
|
||||||
cmake_policy(VERSION 3.0)
|
cmake_policy(VERSION 3.0)
|
||||||
project (mazemaker VERSION 2.0)
|
project (mazemaker VERSION 2.1)
|
||||||
|
|
||||||
SET(EXEC_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH "Installation prefix for executables and object code libraries" FORCE)
|
SET(EXEC_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH "Installation prefix for executables and object code libraries" FORCE)
|
||||||
SET(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include CACHE PATH "Installation prefix for C header files" FORCE)
|
SET(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include CACHE PATH "Installation prefix for C header files" FORCE)
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ int mazemaker_solve(mazegrid_t const* maze, maze_path_t* path) {
|
|||||||
// check to see if we've reached the end
|
// check to see if we've reached the end
|
||||||
if ((x == maze->width - 1) && (y == maze->height - 1)) {
|
if ((x == maze->width - 1) && (y == maze->height - 1)) {
|
||||||
path_copy(&top, path);
|
path_copy(&top, path);
|
||||||
|
mazemaker_path_free(&top);
|
||||||
code = 1;
|
code = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -89,6 +90,9 @@ int mazemaker_solve(mazegrid_t const* maze, maze_path_t* path) {
|
|||||||
PUSH_PQ(pq, PathPQ, newpath, dist + 1);
|
PUSH_PQ(pq, PathPQ, newpath, dist + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// delete old path
|
||||||
|
mazemaker_path_free(&top);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If no path is found, we will run out of new nodes to explore, the queue
|
// If no path is found, we will run out of new nodes to explore, the queue
|
||||||
@@ -103,6 +107,7 @@ int mazemaker_solve(mazegrid_t const* maze, maze_path_t* path) {
|
|||||||
}
|
}
|
||||||
FOREACH_PQ_END
|
FOREACH_PQ_END
|
||||||
}
|
}
|
||||||
|
FREE_PQ(pq);
|
||||||
node_set_free(set);
|
node_set_free(set);
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user