|
|
static short InCheck = false, GenerateAllMoves = false; | static short InCheck = false, GenerateAllMoves = false; |
static short check_determined = false; | static short check_determined = false; |
| |
static short INCscore = 0; |
static short INCscore_local = 0; |
| |
short deepsearchcut = true; | short deepsearchcut = true; |
short tas = false, taxs = false, ssa = false; | short tas = false, taxs = false, ssa = false; |
|
|
node->reply = 0; | node->reply = 0; |
node->flags = local_flag; | node->flags = local_flag; |
node->score = s; | node->score = s; |
node->INCscore = INCscore; |
node->INCscore = INCscore_local; |
| |
if (GenerateAllMoves) | if (GenerateAllMoves) |
{ | { |
|
|
| |
if ((boardu = board[u]) == king) | if ((boardu = board[u]) == king) |
{ | { |
s += 20; INCscore -= 18; |
s += 20; INCscore_local -= 18; |
*local_flag |= check; /* move threatens | *local_flag |= check; /* move threatens |
* opponents king */ | * opponents king */ |
} | } |
|
|
} | } |
while (u != t); | while (u != t); |
| |
INCscore += s; |
INCscore_local += s; |
| |
return s; | return s; |
} | } |
|
|
return; | return; |
} | } |
| |
INCscore = 0; |
INCscore_local = 0; |
| |
#ifdef HISTORY | #ifdef HISTORY |
s += history[hindex(side, mv)]; | s += history[hindex(side, mv)]; |
|
|
{ | { |
/* bonus for square near enemy king */ | /* bonus for square near enemy king */ |
s += 15; | s += 15; |
INCscore += 2; |
INCscore_local += 2; |
local_flag |= kingattack; | local_flag |= kingattack; |
} | } |
else if (distance(t, OwnKing) <= 1) | else if (distance(t, OwnKing) <= 1) |
{ | { |
/* bonus for square near own king */ | /* bonus for square near own king */ |
s += 10; | s += 10; |
INCscore++; |
INCscore_local++; |
local_flag |= kingattack; | local_flag |= kingattack; |
} | } |
} | } |
|
|
{ | { |
/* bonus for promotions */ | /* bonus for promotions */ |
s++; | s++; |
INCscore += value[stage][promoted[piece]] - value[stage][piece]; |
INCscore_local += value[stage][promoted[piece]] - value[stage][piece]; |
} | } |
else | else |
{ | { |
|
|
if (piece == pawn || piece == bishop || piece == rook) | if (piece == pawn || piece == bishop || piece == rook) |
{ | { |
local_flag |= stupid; | local_flag |= stupid; |
INCscore -= 20; |
INCscore_local -= 20; |
} | } |
else | else |
{ | { |
local_flag |= questionable; | local_flag |= questionable; |
INCscore -= 10; |
INCscore_local -= 10; |
} | } |
} | } |
} | } |