14 for (
size_t i = 0; i < weights.
dimension(); ++i)
25 while (black_mask.
any())
30 while (white_mask.
any())
45 for (
int y = 0; y <= 16; ++y)
47 for (
int x = 0; x <= 8; ++x)
49 const int distance = x * 17 + y;
50 table[i][distance][stage] =
64 while (black_mask.
any())
69 while (white_mask.
any())
87 for (
size_t i = 0; i <
ONE_DIM; ++i)
97 for (
size_t i = 0; i <
ONE_DIM; ++i)
107 for (
size_t i = 0; i <
ONE_DIM; ++i)
114template <osl::Player Defense>
121 while (pin_mask.any())
123 const Piece piece = state.
pieceOf(pin_mask.takeOneBit());
130 std::abs(king.
x() - piece.
square().
x()) - 1] +
137 else if (king.
x() == piece.
square().
x())
144 std::abs(king.
y() - piece.
square().
y()) - 1] +
151 std::abs(king.
y() - piece.
square().
y()) - 1] +
162 std::abs(king.
x() - piece.
square().
x()) - 1] +
173 std::abs(king.
x() - piece.
square().
x()) - 1] +
198 for (
size_t i = 0; i <
ONE_DIM; ++i)
205template <osl::Player Defense>
212 while (open_mask.any())
214 const Piece piece = state.
pieceOf(open_mask.takeOneBit());
219 else if (king.
x() == piece.
square().
x())
const PieceMask checkShadow(Player attack) const
attack の駒で動くと開き王手になる可能性がある集合
bool hasEffectAt(Square target) const
対象とするマスにあるプレイヤーの利きがあるかどうか.
const PieceMask pin(Player king) const
bool hasEffectByPtypeStrict(Player attack, Square target) const
target に ptype の利きがあるか?
const Square square() const
const Piece pieceOf(int num) const
Square kingSquare() const
int y() const
将棋としてのY座標を返す.
int x() const
将棋としてのX座標を返す.
static MultiInt evalOne(const NumEffectState &state)
static MultiInt eval(const NumEffectState &state)
static void setUp(const Weights &weights)
static CArray< MultiInt, ONE_DIM > table
static bool pawnAttack(const NumEffectState &state, Piece piece)
static CArray< MultiInt, 48 > pawn_table
static CArray< MultiInt, 560 > distance_table
static CArray< MultiInt, 80 > table
static MultiInt eval(const NumEffectState &state)
static MultiInt evalOne(const NumEffectState &state)
static void setUp(const Weights &weights)
static void setUp(const Weights &weights)
static void setUp(const Weights &weights)
static CArray2d< MultiInt, PTYPE_SIZE, 17 *9 > table
static MultiInt eval(const NumEffectState &state, PieceMask black_mask, PieceMask white_mask)
static void setUp(const Weights &weights, int stage)
static int index(const Square king, const Piece piece)
static CArray< int, PTYPE_SIZE > table
int eval(const NumEffectState &state, PieceMask black_mask, PieceMask white_mask) const
static void setUp(const Weights &weights)
CArray< CArray< T, Capacity2 >, Capacity1 > CArray2d
constexpr Player alt(Player player)
int value(size_t index) const