diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-07-13 17:06:48 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-07-13 17:06:48 -0400 |
commit | 4e8f554286593ec8aca6c61fa0fb9c4934bd640c (patch) | |
tree | 438b87e7003f2ca38b9973543bda8509ff2e9efa /util.h | |
parent | b64ada0dfec5895d14bd0d41cb83779d093970fe (diff) | |
download | mazeoflife-4e8f554286593ec8aca6c61fa0fb9c4934bd640c.tar.gz mazeoflife-4e8f554286593ec8aca6c61fa0fb9c4934bd640c.tar.bz2 mazeoflife-4e8f554286593ec8aca6c61fa0fb9c4934bd640c.zip |
Redesigned the solver algorithm
The new solver algorithm decreases the size of the search space by combining states. A flood fill is used to find all of the positions accessible by the player without changing the board state, and that flood is considered a node in the search graph, rather than there being a node for every position on every board state. Other optimizations are implemented too, like checking for changes locally instead of using tick, and using unordered_map/unordered_set because bitsets are hashable. Also changed wrap to use references, finally. refs #1
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/util.h b/util.h index 365a759..0e1fa2e 100644 --- a/util.h +++ b/util.h | |||
@@ -5,7 +5,7 @@ | |||
5 | #ifndef UTIL_H | 5 | #ifndef UTIL_H |
6 | #define UTIL_H | 6 | #define UTIL_H |
7 | 7 | ||
8 | void wrap(int* x, int* y); | 8 | void wrap(int& x, int& y); |
9 | TTF_Font* loadFont(int size); | 9 | TTF_Font* loadFont(int size); |
10 | const char* getDataFile(); | 10 | const char* getDataFile(); |
11 | SDL_Texture* loadImage(SDL_Renderer* renderer, std::string file); | 11 | SDL_Texture* loadImage(SDL_Renderer* renderer, std::string file); |