aboutsummaryrefslogtreecommitdiff
path: root/src/main/main.cpp
diff options
context:
space:
mode:
authorCharlie Blake2018-07-25 09:49:34 +0100
committerCharlie Blake2018-07-26 10:32:38 +0100
commite1ea0d49c5804921cd4910e891ed263172608d49 (patch)
tree44df2ad6c36873e091a7c3a2892c4edf2c69901a /src/main/main.cpp
parentMerge pull request #78 from thecharlesblake/add-canfield (diff)
downloadmetasol-e1ea0d49c5804921cd4910e891ed263172608d49.tar.gz
metasol-e1ea0d49c5804921cd4910e891ed263172608d49.zip

Make timeout operate using single thread

Diffstat (limited to 'src/main/main.cpp')
-rw-r--r--src/main/main.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/main/main.cpp b/src/main/main.cpp
index 5c8708e..e8f287b 100644
--- a/src/main/main.cpp
+++ b/src/main/main.cpp
@@ -123,15 +123,14 @@ void solve_input_files(const vector<string> input_files, const sol_rules& rules,
void solve_game(const game_state& gs, command_line_helper& clh) {
solver solv(gs, clh.get_cache_capacity());
- bool solution = solv.run() == solver::sol_state::solved;
-
- if (solution) {
- if (!clh.get_classify()) solv.print_solution();
- cout << "Solved\n";
- } else {
- if (!clh.get_classify()) cout << "Deal:\n" << gs << "\n";
- cout << "No Possible Solution\n";
- }
+ solver::result result = solv.run();
- cout << solv.get_solution_info();
+ if (!clh.get_classify()) {
+ if (result.sol_type == solver::result::type::SOLVED) {
+ solv.print_solution();
+ } else {
+ cout << "Deal:\n" << gs << "\n";
+ }
+ }
+ cout << result;
}