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