aboutsummaryrefslogtreecommitdiff
path: root/src/main/solver/solver.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/solver/solver.h')
-rw-r--r--src/main/solver/solver.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/main/solver/solver.h b/src/main/solver/solver.h
new file mode 100644
index 0000000..c1a72d3
--- /dev/null
+++ b/src/main/solver/solver.h
@@ -0,0 +1,39 @@
+//
+// 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/game_state.h"
+#include "game/sol_rules.h"
+
+class solver {
+public:
+ solver(const game_state, const sol_rules&);
+ 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;
+ const sol_rules rules;
+ bool been_run;
+ node solution;
+ bool solution_found;
+ int states_searched;
+};
+
+
+#endif //SOLVITAIRE_SOLVER_H