my $score;
if ($mate > 0) {
# Side to move mates
- $mate = 99999 - $mate;
+ $score = 99999 - $mate;
} else {
# Side to move is getting mated (note the double negative for $mate)
- $mate = -99999 - $mate;
+ $score = -99999 - $mate;
}
if ($invert) {
$score = -$score;
# position in the meantime, we might query a completely
# different position! But that's fine.
} else {
- die "Unknown response state state " . $response->{'Response'}{'StateString'};
+ die "Unknown response state " . $state;
}
# Wait a second before we schedule another one.