12 return toupper(a) == toupper(b);
17 return s1.size() == s2.size() &&
53 for (
const auto& c: colors) {
61 : value(value), name(name), valid(valid)
71 assert((1 <= n) && (n <= 18));
82 case 10:
return K_K10;
83 case 11:
return K_K11;
84 case 12:
return K_K12;
85 case 13:
return K_K13;
86 case 14:
return K_K14;
87 case 15:
return K_K15;
88 case 16:
return K_K16;
89 case 17:
return K_K17;
90 case 18:
return K_K18;
158 return os << c.
value;
164 if (!color.isValid())
return;
165 os <<
"\033[" << color <<
"m";
171 if (!color.isValid())
return;
177 const Move *last_move)
const
196 for(
int x=9*pieces->getSuji(1).size();x>0;x--)
200 os <<
"+" << std::endl;
202 for(
int y=1;y<=9;y++)
238 for(
int x=9*pieces->getSuji(1).size();x>0;x--)
242 os <<
"+" << std::endl;
253 os << state.
turn() << std::endl;
bool isInvalid() const
state に apply 可能でない場合にtrue
static const CArray< Ptype, 7 > order
持駒の表示で良く使われる順番.
const Piece pieceOnBoard(Square sq) const
int countPiecesOnStand(Player pl, Ptype ptype) const
持駒の枚数を数える
static const CArray< std::string, 32 > stand
static const Color Yellow
static const Color Purple
static const Color colorFor(const std::string &str)
文字列に対応するColor objectを返す
static const Color LightGreen
static const Color LightCyan
static const Color LightGray
static const Color LightBlue
static const Color DarkGray
static const Color LightRed
static const Color NONE
色指定しない(デフォルトのまま)ことを示す特別なオブジェクト
static const Color LightPurple
void print(const SimpleState &state, const Move *last_move=NULL) const
出力
bool caseInsentiveCharCompare(char a, char b)
bool caseInsentiveCompare(const std::string &s1, const std::string &s2)
std::string eucToLang(const std::string &src)
std::string kanjiNumber(const int n)
漢数字を返す(持ち駒の数などで用いる)
std::ostream & operator<<(std::ostream &os, const Color &c)
Player getOwner(PtypeO ptypeO)
constexpr bool isPiece(Ptype ptype)
ptypeが空白やEDGEでないかのチェック
PtypeO
Player + Ptype [-15, 15] PtypeO の O は Owner の O.
PtypeO newPtypeO(Player player, Ptype ptype)
static const CArray< std::string, 10 > dan
static const CArray< std::string, 32 > pieces
static const CArray< std::string, 10 > suji
static const CArray< std::string, 10 > suji
static const CArray< std::string, 10 > dan
static const CArray< std::string, 32 > pieces
static const CArray< std::string, 32 > pieces
盤面上の駒の漢字文字
static const CArray< std::string, 10 > dan
段数の文字
static const CArray< std::string, 10 > suji
筋の文字。駒の文字幅に合わせる必要がある。