16 for (
int x=1; x<=9; ++x) {
17 for (
int y=1; y<=9; ++y) {
18 const Square position(x,y);
43 std::pair<Ptype,Ptype> pair;
48 cache[cur++] = basic + pair.first;
49 cache[cur++] = basic +
AttackBase + pair.second;
60 int op_king_distance = abs(kings[
alt(turn)].x()-position.
x())
61 + abs(kings[
alt(turn)].y()-position.
y());
62 if (op_king_distance == 0)
67 cache[cur++] = basic +
OpKingBase + op_king_distance;
68 int my_king_distance = abs(kings[turn].x()-position.
x())
69 + abs(kings[turn].y()-position.
y());
70 if (my_king_distance == 0)
75 cache[cur++] = basic +
MyKingBase + my_king_distance;
91 for (
int i=1; i<4; ++i) {
117 i<PtypeTraits<LANCE>::indexLimit; ++i) {
125 i<PtypeTraits<BISHOP>::indexLimit; ++i) {
135 i<PtypeTraits<ROOK>::indexLimit; ++i) {
157 Square attack_to2 = attack_to;
174 attacked =
alt(attacked);
195 if (threat_at == attack_to
198 piece.
square(), attack_to)))
void fill(const T_simple &value=T_simple())
void push_back(const T &e)
bool isNormal() const
INVALID でも PASS でもない.
const checkmate::King8Info king8Info(Player king) const
bool hasEffectAt(Square target) const
対象とするマスにあるプレイヤーの利きがあるかどうか.
Square mobilityOf(Direction d, int num) const
PieceMask pinOrOpen(Player king) const
bool isPromoted() const
promoteした駒かどうかをチェックする
const Square square() const
bool isOnBoardByOwner() const
piece がプレイヤーPの持ち物でかつボード上にある駒の場合は true.
const Piece pieceOnBoard(Square sq) const
const Piece pieceOf(int num) const
Square kingSquare() const
const Piece pieceAt(Square sq) const
unsigned int index() const
bool isPieceStand() const
int y() const
将棋としてのY座標を返す.
bool isNeighboring8(Square to) const
bool isEdge() const
onBoardから8近傍のオフセットを足した点がedgeかどうかの判定 そこそこ速くなった.
int x() const
将棋としてのX座標を返す.
unsigned int libertyCount() const
libertyの数
bool test(unsigned int i) const
bool hasLastMove(size_t last=1) const
const Move lastMove(size_t last=1) const
static void makeLongAttackOne(StateInfo &info, Piece piece, Direction d)
static void updateCache(StateInfo &)
static int longAttackIndex(osl::PtypeO ptypeo)
static bool hasSafeCapture(NumEffectState &state, Move)
static int classifyEffect9(const NumEffectState &state, Player player, Square to)
static void updateCacheOne(Square target, StateInfo &info)
static void updateCache(StateInfo &info)
static void supportAttack(const NumEffectState &state, Square to, const PieceMask &my_pin, const PieceMask &op_pin, Player turn, std::pair< Ptype, Ptype > &out)
const BoardTable Board_Table
unsigned int ptypeOIndex(PtypeO ptypeo)
Offset32Base< 8, 9 > Offset32
constexpr bool isPiece(Ptype ptype)
ptypeが空白やEDGEでないかのチェック
PtypeO
Player + Ptype [-15, 15] PtypeO の O は Owner の O.
constexpr Player alt(Player player)
PtypeO altIfPiece(PtypeO ptypeO)
Pieceの時にはowner を反転する
static bool effectiveAttack(NumEffectState &state, Move move, int depth)
move を指した後,alt(move.player())が取ると詰みかどうか.
const NumEffectState * state
CArray2d< bool, 40, 2 > attack_shadow
const MoveStack * history
CArray< int, 16 > pattern_square_t
FixedCapacityVector< int, 8 > long_attack_t
BoardMask changed_effects
CArray< pattern_square_t, Square::SIZE > pattern_cache
PieceMask last_add_effect
CArray< PieceMask, 2 > pin
CArray2d< long_attack_t, 40, 8 > long_attack_cache