8   const Square opKingSquare = state.kingSquare(
alt(turn));
 
    9   const int x = opKingSquare.
x();
 
   10   const int y = opKingSquare.y();
 
   12   const int distance_m = abs(x - to.
x()) + abs(y - to.
y());
 
   13   const int sign = -1 + 2 * (turn == 
BLACK);
 
   23   for (
int i=min; i<=
max; i++)
 
   24     for (
int j=min; j<=
max; j++){
 
   27         int eff_w   = state.countEffect(
alt(turn),pos);
 
   30         int eff_b   = state.countEffect(turn,pos);
 
   32         effect_e   += (eff_b > eff_w);
 
   38   for (
int i=min; i<=
max; i++)
 
   39     for (
int j=min; j<=
max; j++){
 
   42         Piece pieceOnBoard = state.pieceOnBoard(pos);
 
   44           escapeKing += (!state.hasEffectAt(turn, pos));
 
   49   const double coefCapture[16]
 
   50     ={0.0, 0.0,  0.0, 0.0, 0.0, 5.06, 4.73, 7.70, 
 
   51       0.0, 9.78, 0.0, 0.0, 0.0, 5.06, 4.73, 7.70};
 
   59   for (
int i=min; i<=
max; i++)
 
   60     for (
int j=min; j<=
max; j++){
 
   61       Square pos(x+sign*j, y+sign*i);
 
   63         neigh8 += neigh[3*(i+1)+j+1]*state.hasEffectByPiece(state.pieceOnBoard(to), pos);
 
   66   const double value_p = 
 
   67     9.62*(double)state.countPiecesOnStand(turn, 
ROOK)
 
   68     +  6.07*(double)state.countPiecesOnStand(turn, 
BISHOP)
 
   69     +  8.27*(double)state.countPiecesOnStand(turn, 
GOLD)
 
   70     +  5.64*(double)state.countPiecesOnStand(turn, 
SILVER)
 
   71     +  4.06*(double)state.countPiecesOnStand(turn, 
KNIGHT)
 
   72     +  2.77*(double)state.countPiecesOnStand(turn, 
LANCE)
 
   73     +  1.05*(double)state.countPiecesOnStand(turn, 
PAWN);
 
   78     + 10.20*(double)add_effect
 
   79     +  6.41*(
double)effect_b
 
   80     -  1.24*(double)effect_w
 
   81     + 13.79*(
double)effect_e
 
   82     -  1.98*(double)escapeKing
 
   83     -  3.11*(
double)distance_m