Skip to content

Commit

Permalink
Add enginename option
Browse files Browse the repository at this point in the history
  • Loading branch information
fsmosca committed Feb 12, 2020
1 parent 6f8777f commit eb929ba
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions chess-artist.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

# Constants
APP_NAME = 'Chess Artist'
APP_VERSION = 'v2.11'
APP_VERSION = 'v2.12'
BOOK_MOVE_LIMIT = 30
BOOK_SEARCH_TIME = 200
MAX_SCORE = 32000
Expand Down Expand Up @@ -74,6 +74,7 @@ def __init__(self, infn, outfn, eng, **opt):
self.draw = opt['-draw']
self.minScoreStopAnalysis = opt['-min-score-stop-analysis']
self.maxScoreStopAnalysis = opt['-max-score-stop-analysis']
self.engineName = opt['-enginename']
self.bookMove = None
self.passedPawnIsGood = False
self.whitePassedPawnCommentCnt = 0
Expand Down Expand Up @@ -885,7 +886,11 @@ def GetMaterialBalance(fen):

def GetEngineIdName(self):
""" Returns the engine id name """
if self.engineName is not None:
return self.engineName

engineIdName = self.eng[0:-4]

p = subprocess.Popen(self.eng, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
universal_newlines=True, bufsize=1)
Expand All @@ -899,6 +904,7 @@ def GetEngineIdName(self):
break
self.Send(p, 'quit')
p.communicate()

return engineIdName

def IsKingSafetyGood(self, nextFen, side):
Expand Down Expand Up @@ -2425,6 +2431,9 @@ def main():
parser.add_argument('-e', '--enginefile',
help='input engine filename',
required=True)
parser.add_argument('--enginename',
help='input uci engine id name, if not specified ' +
'engine id name will be used.', required=False)
parser.add_argument('-n', '--engineoptions',
help='input engine options, like threads, hash and others ' +
'example: --engineoptions "Hash value 128, Threads value 1"',
Expand Down Expand Up @@ -2534,7 +2543,8 @@ def main():
'-loss': args.loss,
'-min-score-stop-analysis': args.min_score_stop_analysis,
'-max-score-stop-analysis': args.max_score_stop_analysis,
'-draw': args.draw
'-draw': args.draw,
'-enginename': args.enginename
}

if args.log:
Expand Down

0 comments on commit eb929ba

Please sign in to comment.