29 const int y = king.
y() +
sign(state.
turn())*4;
30 if (y != move.
to().
y())
32 const int x = move.
to().
x();
33 return (x == king.
x() || abs(king.
x() - x) == 2);
45 for (
int i=0; i<2; ++i) {
46 const Square kp = knight_position[i];
77 && (info.dropCandidate()
81 && (info.dropCandidate() || info.moveCandidate2()
82 || info.liberty() == 0))
84 if (info.liberty() == 0
105 std::cerr << cstate << move <<
"\n", assert(0);
Ptype unpromote(Ptype ptype)
ptypeがpromote後の型の時に,promote前の型を返す. promoteしていない型の時はそのまま返す ...
bool hasEffectIf(PtypeO ptypeo, Square attacker, Square target) const
attackerにptypeoの駒がいると仮定した場合にtargetに利きがあるかどうか を stateをupdateしないで確かめる...
bool canMoveOn() const
Player Pの駒が,thisの上に移動できるか? PIECE_EMPTY 0x00008000 BLACK_PIECE 0x000XxxYY X>=2...
constexpr Player alt(Player player)
PtypeO capturePtypeO() const
void makeUnmakeMove(Move move, Function &f)
const Piece pieceAt(Square sq) const
int y() const
将棋としてのY座標を返す.
const Piece pieceOnBoard(Square sq) const
PtypeO ptypeO() const
移動後のPtype, i.e., 成る手だった場合成った後
static bool captureForKnightCheck(const NumEffectState &state, Move move, Square king)
int x() const
将棋としてのX座標を返す.
PtypeO newPtypeO(Player player, Ptype ptype)
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
static bool knight2Step(const NumEffectState &state, Move move, Square king)
static bool isCandidate(const NumEffectState &state, Move move)
constexpr int sign(Player player)
const checkmate::King8Info king8Info(Player king) const
bool inCheck(Player P) const
Pの玉が王手状態
Ptype capturePtype() const
bool match(const NumEffectState &state, Move move, const RatingEnv &) const
bool hasEffectByPtypeStrict(Player attack, Square target) const
target に ptype の利きがあるか? 成不成を区別
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