You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using templates and if const implement something like following:
template <
int material=1, //Qs*9+Rs*5+Bs*3+Ks*3+Ps*1
int almost_promoted=0, // white pawns on 7th rank - black pawns on 2nd rank
int king_protection=0, // count pieces around the king
int coverage=0, // count squares controlled by white - black
int legal_moves=0 // number of legal moves
>
int evaluate()
{
int ret = 0;
if const (material > 0) ret+= material * evaluate_material();
if const (almost_promoted) ret+= almost_promoted * almost_promoted_evaluate();
if const (king_protection) ret+= king_protection * king_protection_evaluate();
if const (coverage) ret+= coverage * coverage_evaluate();
}
The text was updated successfully, but these errors were encountered:
Using templates and
if const
implement something like following:The text was updated successfully, but these errors were encountered: