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 Square nextSquare(Player P, Square pos, Direction dr) const
next position from pos for player P.
array_t::const_iterator const_iterator
Ptype capturePtype() const
const Square from() const
const NumBitmapEffect effectSetAt(Square sq) const
const checkmate::King8Info king8Info(Player king) const
bool hasEffectNotBy(Player player, Piece piece, Square target) const
対象とするマスにあるプレイヤーの(ただしある駒以外)利きがあるかどうか.
int countEffect(Player player, Square target) const
利きの数を数える.
bool hasEffectByPiece(Piece attack, Square target) const
駒attack が target に利きを持つか (旧hasEffectToと統合)
bool hasEffectAt(Square target) const
対象とするマスにあるプレイヤーの利きがあるかどうか.
bool inCheck(Player P) const
Pの玉が王手状態
const mask_t longEffectAt(Square target) const
void makeUnmakeMove(Move move, Function &f)
const PieceMask & piecesOnBoard(Player p) const
bool hasEffectByPtypeStrict(Player attack, Square target) const
target に ptype の利きがあるか? 成不成を区別
const Square square() const
bool canMoveOn() const
Player Pの駒が,thisの上に移動できるか? PIECE_EMPTY 0x00008000 BLACK_PIECE 0x000XxxYY X>=2, YY>0 PIECE_EDGE 0xfff1...
bool isOnBoardByOwner() const
piece がプレイヤーPの持ち物でかつボード上にある駒の場合は true.
const Piece pieceOnBoard(Square sq) const
bool hasPieceOnStand(Player player, Ptype ptype) const
const Piece pieceOf(int num) const
Square kingSquare() const
const Piece pieceAt(Square sq) const
bool isNeighboring8(Square to) const
深さ固定で,その深さまで depth first searchで読む詰将棋.
const ProofDisproof hasEscapeByMoveOfTurn(Move next_move, int depth)
unsigned int liberty() const
8-15 bit 目を 0-7bitにshiftして返す
unsigned int moveCandidate2() const
24-31 bit 目を 0-7bitにshiftして返す
unsigned int dropCandidate() const
0-7 bit 目を返す
bool isCheckmateSuccess() const
Ptype unpromote(Ptype ptype)
ptypeがpromote後の型の時に,promote前の型を返す. promoteしていない型の時はそのまま返す
const BoardTable Board_Table
constexpr Player alt(Player player)
PtypeO captured(PtypeO ptypeO)
unpromoteすると共に,ownerを反転する.
void operator()(Square last_to)
static bool cannotCapture(NumEffectState &state, Square last_to, int depth)
手番の側がSquare の駒を取っても詰みがないか.
static bool effectiveAttackCandidate0(const NumEffectState &state, Move move)
depth==0でeffectiveAttackになる可能性がなければfalse
static bool effectiveAttack(NumEffectState &state, Move move, int depth)
move を指した後,alt(move.player())が取ると詰みかどうか.