From dd773b98b2dbe86e1b6dda36b58cedd46148eb26 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sun, 20 Mar 2016 23:06:14 +0100 Subject: [PATCH] Use PV and history information for better move selection. --- www/js/remoteglot.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/www/js/remoteglot.js b/www/js/remoteglot.js index 486ca8d..5f3223d 100644 --- a/www/js/remoteglot.js +++ b/www/js/remoteglot.js @@ -1773,6 +1773,15 @@ var get_best_move = function(game, source, target) { move_hash[moves[i].san] = moves[i]; } + // History and PV take priority over the display lines. + for (var i = 0; i < 2; ++i) { + var line = display_lines[i]; + var first_move = line.pretty_pv[line.start_display_move_num]; + if (move_hash[first_move]) { + return move_hash[first_move]; + } + } + var best_move = null; var best_move_score = null; -- 2.39.2