From: Steinar H. Gunderson Date: Sun, 20 Mar 2016 22:06:14 +0000 (+0100) Subject: Use PV and history information for better move selection. X-Git-Url: https://git.sesse.net/?p=remoteglot;a=commitdiff_plain;h=dd773b98b2dbe86e1b6dda36b58cedd46148eb26 Use PV and history information for better move selection. --- 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;