From 1f9089849f964b28158144fce2d053149cf8a312 Mon Sep 17 00:00:00 2001 From: Tom Harley Date: Mon, 25 Feb 2019 14:49:54 +0000 Subject: Check for majority moves after regular move Previously, majority moves were checked for before regular moves. This would usually result in time wasted after a reveal-reset. --- metasol.cpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/metasol.cpp b/metasol.cpp index 6dd1047..4b96f97 100644 --- a/metasol.cpp +++ b/metasol.cpp @@ -818,20 +818,6 @@ solve_status run_loop(ms_game_state *gs, ms_rules *r, ms_settings *s, unsigned vote_count = s->max_votes; ms_move m; - /* - * If a majority of voters already agree on a move, running other voters is - * a waste of time. - */ - bool mm = false; - while (find_majority_move(votes, vote_count, &m)) { - mm = true; - debug("majority move found\n"); - move_decided(gs, r, &m, votes, vote_count); - } - if (mm) { - return loop_check(gs, r, s); - } - /* * Set up the thread_info structs and add a job to the threadpool for each * one. @@ -866,6 +852,16 @@ solve_status run_loop(ms_game_state *gs, ms_rules *r, ms_settings *s, if (find_modal_move(votes, vote_count, &m)) { move_decided(gs, r, &m, votes, vote_count); } + + /* + * If a majority of voters already agree on a move, running other voters is + * a waste of time. + */ + while (find_majority_move(votes, vote_count, &m)) { + debug("majority move found\n"); + move_decided(gs, r, &m, votes, vote_count); + } + return loop_check(gs, r, s); } -- cgit v1.2.1