From e1ea0d49c5804921cd4910e891ed263172608d49 Mon Sep 17 00:00:00 2001 From: Charlie Blake Date: Wed, 25 Jul 2018 09:49:34 +0100 Subject: Make timeout operate using single thread --- src/main/main.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/main/main.cpp') 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 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; } -- cgit v1.2.1