Go to the documentation of this file.
23 using namespace move_classifier;
36 if (Neighboring8Direct::hasEffect(state,
captured.ptypeO(),
59 for (
int i=0; i<2; ++i) {
60 const Square kp = knight_position[i];
75 for (
int i=0; i<2; ++i) {
76 const Square kp = knight_position[i];
88 if (Neighboring8Direct::hasEffectOrAdditional(state, p.
ptypeO(), p.
square(), king)
96 const Square kp = knight_position[i];
126 if (defense.
result && ! effectiveAttackCandidate0(state, move))
127 std::cerr << state << move <<
"\n", assert(0);
134 Square last_to,
int depth)
139 using namespace move_generator;
140 using namespace move_action;
142 GenerateCapture::generate(state, last_to, moves);
154 if (p->ptype() !=
KING)
const Piece pieceAt(Square sq) const
const PieceMask & piecesOnBoard(Player p) const
unsigned int liberty() const
8-15 bit 目を 0-7bitにshiftして返す
bool isCheckmateSuccess() const
bool canMoveOn() const
Player Pの駒が,thisの上に移動できるか? PIECE_EMPTY 0x00008000 BLACK_PIECE 0x000XxxYY X>=2, YY>0 PIECE_EDGE 0xfff1...
const BoardTable Board_Table
const ProofDisproof hasEscapeByMoveOfTurn(Move next_move, int depth)
const checkmate::King8Info king8Info(Player king) const
constexpr Player alt(Player player)
static bool effectiveAttackCandidate0(const NumEffectState &state, Move move)
depth==0でeffectiveAttackになる可能性がなければfalse
const NumBitmapEffect effectSetAt(Square sq) const
static bool cannotCapture(NumEffectState &state, Square last_to, int depth)
手番の側がSquare の駒を取っても詰みがないか.
array_t::const_iterator const_iterator
bool hasEffectAt(Square target) const
対象とするマスにあるプレイヤーの利きがあるかどうか.
bool inCheck(Player P) const
Pの玉が王手状態
unsigned int dropCandidate() const
0-7 bit 目を返す
const Piece pieceOf(int num) const
const Piece pieceOnBoard(Square sq) const
bool hasEffectByPtypeStrict(Player attack, Square target) const
target に ptype の利きがあるか? 成不成を区別
Ptype capturePtype() const
bool hasEffectNotBy(Player player, Piece piece, Square target) const
対象とするマスにあるプレイヤーの(ただしある駒以外)利きがあるかどうか.
bool hasEffectByPiece(Piece attack, Square target) const
駒attack が target に利きを持つか (旧hasEffectToと統合)
static bool effectiveAttack(NumEffectState &state, Move move, int depth)
move を指した後,alt(move.player())が取ると詰みかどうか.
bool isOnBoardByOwner() const
piece がプレイヤーPの持ち物でかつボード上にある駒の場合は true.
const Square from() const
bool hasPieceOnStand(Player player, Ptype ptype) const
PtypeO captured(PtypeO ptypeO)
unpromoteすると共に,ownerを反転する.
const Square nextSquare(Player P, Square pos, Direction dr) const
next position from pos for player P.
Square kingSquare() const
unsigned int moveCandidate2() const
24-31 bit 目を 0-7bitにshiftして返す
bool isNeighboring8(Square to) const
const Square square() const
void operator()(Square last_to)
深さ固定で,その深さまで depth first searchで読む詰将棋.
const mask_t longEffectAt(Square target) const
void makeUnmakeMove(Move move, Function &f)
int countEffect(Player player, Square target) const
利きの数を数える.
Ptype unpromote(Ptype ptype)
ptypeがpromote後の型の時に,promote前の型を返す. promoteしていない型の時はそのまま返す