aboutsummaryrefslogtreecommitdiff
path: root/src/main/solver.h
diff options
context:
space:
mode:
authorthecharlesblake2017-10-26 14:51:13 +0100
committerthecharlesblake2017-10-27 10:28:29 +0100
commit3eff79ed14f1fda1f148a9a4c5c3a1ae4edbee37 (patch)
treee0d25f622a2e35e72172cc0409e4c0937ed2c3f5 /src/main/solver.h
parentDraft of OO game logic (diff)
downloadmetasol-3eff79ed14f1fda1f148a9a4c5c3a1ae4edbee37.tar.gz
metasol-3eff79ed14f1fda1f148a9a4c5c3a1ae4edbee37.zip

BH Solver with path outputted, based on user input

Diffstat (limited to 'src/main/solver.h')
-rw-r--r--src/main/solver.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/main/solver.h b/src/main/solver.h
new file mode 100644
index 0000000..0520cc7
--- /dev/null
+++ b/src/main/solver.h
@@ -0,0 +1,36 @@
+//
+// Created by thecharlesblake on 10/24/17.
+//
+
+#ifndef SOLVITAIRE_SOLVER_H
+#define SOLVITAIRE_SOLVER_H
+
+#include <string>
+#include <vector>
+
+#include <boost/optional.hpp>
+
+#include "game_state.h"
+
+class solver {
+public:
+ solver(const game_state);
+ bool run();
+
+ friend std::ostream& operator<< (std::ostream&, const solver&);
+
+private:
+ struct node {
+ node(const game_state);
+ std::vector<game_state> history;
+ game_state state;
+ };
+
+ const node root;
+ bool been_run;
+ node solution;
+ bool solution_found;
+};
+
+
+#endif //SOLVITAIRE_SOLVER_H