The original code of strelka has code like the following
endgame += cnt * mobility_knight_endgame;//black minus
opening += cnt * mobility_knight_opening;//black minus
I can simply have array of 2 numbers 1 and -1 and have
endgame += cnt * mobility_knight_endgame*mult[side]
opening += cnt * mobility_knight_opening*mult[side]//black minus
Second alternative is to have special arrays and have
endgame[side]+=cnt*mobility_knight_endgame
In this case you need in the end to substract in order to find the score.
Third alternative is to have
Code: Select all
#define eval(a,side) ((side)==White)?(a):(0-(a)))
endgame[side]+=cnt*eval(mobility_knight_endgame,side)