Go to the documentation of this file.
3 #ifndef OSL_CHECKMATE_PROOF_NUMBER_TABLE_H
4 #define OSL_CHECKMATE_PROOF_NUMBER_TABLE_H
52 assert((d !=
UUL) && (d !=
UUR));
53 assert(liberty_mask <= 0xff);
67 const unsigned int liberty_mask = info.
liberty();
78 const unsigned int liberty_mask = info.
liberty();
83 if (to + offset + offset != king)
87 else if (ptype !=
LANCE)
uint8_t liberty
玉の自由度の予測値.
static bool hasEffect(const NumEffectState &, Square target, Player attack)
target に attack の追加利きが一つでもあるか. 相手の影利きが先にある場合は対象としない.
bool isMajor(Ptype ptype)
unsigned int liberty() const
8-15 bit 目を 0-7bitにshiftして返す
CArray2d< CArray< Liberty, DIRECTION_SIZE >, 0x100u, PTYPE_SIZE > liberties
一つの王手 -> Liberty: long なdirection は1マスあけた王手を意味する
const BoardTable Board_Table
constexpr Player alt(Player player)
CArray2d< uint8_t, 0x100u, 0x100u > other_move_liberty
それ以外の移動liberty: [liberty][move_mask]
const ProofDisproof attackEstimation(const NumEffectState &state) const
全て
Direction getLongDirection(Offset32 offset32) const
Direction getShort8(Square from, Square to) const
int max(Player p, int v1, int v2)
uint64_t uint64Value() const
int libertyAfterAllDrop(const NumEffectState &state) const
drop のみ
int libertyAfterAllMove(const NumEffectState &state) const
移動 のみ
unsigned int index() const
Liberty(uint8_t l=0, bool e=false)
CArray2d< uint8_t, 0x100u, 0x100u > pmajor_liberty
龍や馬で王手をかけられる時のliberty: [liberty][move_mask]
CArray2d< uint8_t, 0x10000u, 8 > drop_liberty
全ての有効drop -> 最小liberty.
const Offset getShortOffsetNotKnight(Offset32 offset32) const
Longの利きの可能性のあるoffsetの場合は, 反復に使う offsetを Knight以外のShortの利きのoffsetの場合はそれ自身を返す.
const Liberty countLibertyShortNotKnight(Player player, Square to, Ptype ptype, Square king, King8Info info) const
8近傍へのdropまたは取れない移動後のlibertyの予測値を返す.
bool has_effect
false の場合は必ず空き王手
static int countBit(Integer mask)
CArray2d< uint64_t, 2, Square::SIZE > edge_mask
ProofNumberTable Proof_Number_Table
int libertyAfterAllCheck(const NumEffectState &state) const
全て
constexpr bool isLong(Direction d)
bool isNeighboring8(Square to) const
const King8Info resetEdgeFromLiberty(Player king_player, Square king, King8Info info) const
liberty から盤の淵(xかyが1か9)を取り除く.
int countLiberty(const NumEffectState &state, int liberty_count, Move move, Square king, King8Info info) const
move は王手である必要がある
int disproofAfterAllCheck(const NumEffectState &, Player, King8Info) const
証明数(proof number)と反証数(disproof number).
CArray2d< uint8_t, 0x100u, 0x100u > promote_liberty
王が1,2段目にいる時の移動王手によるliberty: [liberty][move_mask].
const Liberty countLiberty(Ptype ptype, Direction d, unsigned int liberty_mask) const
dir 方向からの王手をかけた時のlibertyの予想
int countEffect(Player player, Square target) const
利きの数を数える.
const Liberty countLibertyLong(Player player, Square to, Ptype ptype, Square king, King8Info info) const
const PtypeO PTYPEO_EDGE __attribute__((unused))
Ptype unpromote(Ptype ptype)
ptypeがpromote後の型の時に,promote前の型を返す. promoteしていない型の時はそのまま返す