Permalink
Browse files

Merge pull request #20 from efirvida/patch-1

fix parse bestmove
  • Loading branch information...
imor committed Aug 23, 2015
2 parents 1dae303 + 5390249 commit 6f0c0525216503c9633c369dfa6a348bd42ab7be
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/main.js
View
@@ -201,7 +201,7 @@ Engine.prototype.timeLimitedGoCommand = function (infoHandler,
infoHandler('info', lines[i]);
} else if (stringifiedLine.startsWith('bestmove')) {
self.engineProcess.stdout.removeListener('data', engineStdoutListener);
var moveRegex = /bestmove (.*?) /g;
var moveRegex = /bestmove (\w+)(.*)?/g;
var match = moveRegex.exec(lines[i]);
if (match) {
deferred.resolve(utilities.convertToMoveObject(match[1]));
@@ -270,7 +270,7 @@ Engine.prototype.stopCommand = function () {
self.engineProcess.stdout.removeListener('data', self.goInfiniteListener);
}
self.engineProcess.stdout.removeListener('data', engineStdoutListener);
var moveRegex = /bestmove (.*?) /g;
var moveRegex = /bestmove (\w+)(.*)?/g;
var match = moveRegex.exec(lines[i]);
if (match) {
deferred.resolve(utilities.convertToMoveObject(match[1]));

0 comments on commit 6f0c052

Please sign in to comment.