Go to the documentation of this file.
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;
static const Color Yellow
bool isInvalid() const
state に apply 可能でない場合にtrue
static const CArray< std::string, 32 > pieces
盤面上の駒の漢字文字
std::string kanjiNumber(const int n)
漢数字を返す(持ち駒の数などで用いる)
static const CArray< std::string, 10 > dan
段数の文字
static const Color LightBlue
PtypeO newPtypeO(Player player, Ptype ptype)
Player getOwner(PtypeO ptypeO)
static const Color LightGreen
static const CArray< std::string, 32 > pieces
static const CArray< std::string, 10 > dan
static const Color LightRed
const Piece pieceOnBoard(Square sq) const
bool caseInsentiveCompare(const std::string &s1, const std::string &s2)
static const CArray< std::string, 32 > stand
static const Color LightCyan
static const CArray< std::string, 10 > dan
static const Color LightGray
static const CArray< std::string, 10 > suji
static const CArray< Ptype, 7 > order
持駒の表示で良く使われる順番.
PtypeO
Player + Ptype [-15, 15] PtypeO の O は Owner の O.
static const Color colorFor(const std::string &str)
文字列に対応するColor objectを返す
constexpr bool isPiece(Ptype ptype)
ptypeが空白やEDGEでないかのチェック
std::ostream & operator<<(std::ostream &os, const Color &c)
static const Color LightPurple
static const Color NONE
色指定しない(デフォルトのまま)ことを示す特別なオブジェクト
static const CArray< std::string, 10 > suji
筋の文字。駒の文字幅に合わせる必要がある。
static const Color DarkGray
void print(const SimpleState &state, const Move *last_move=NULL) const
出力
static const CArray< std::string, 32 > pieces
static const CArray< std::string, 10 > suji
std::string eucToLang(const std::string &src)
int countPiecesOnStand(Player pl, Ptype ptype) const
持駒の枚数を数える
bool caseInsentiveCharCompare(char a, char b)
static const Color Purple