/// <summary> /// 将棋盤をコンソールへ出力するぜ☆(^▽^) /// ログに向いた、シンプルな表示☆ /// </summary> /// <returns></returns> public static void Setumei_Kyokumen(int teme, StringBuilder hyoji) { int banYokoHaba_tmp = PureSettei.banYokoHaba; int banTateHaba_tmp = PureSettei.banTateHaba; Setumei_Hanyo((int dan, Masu ms) => { Piece km = PureMemory.gky_ky.yomiKy.yomiShogiban.yomiIbashoBan.GetBanjoKoma(ms); return(SpkKoma.ToSetumei(km)); }, banYokoHaba_tmp, banTateHaba_tmp, teme, hyoji); }
/// <summary> /// 改造Fen /// 例: fen kr1/1h1/1H1/1R1 K2z 1 /// 盤上の駒配置、持ち駒の数、手番の対局者 /// </summary> public static void AppendFenTo( FenSyurui f, StringBuilder syuturyoku) { syuturyoku.Append(f == FenSyurui.sfe_n ? "sfen " : "fen "); // 盤上 { int space = 0; for (int iDan = 0; iDan < PureSettei.banTateHaba; iDan++) { for (int iSuji = 0; iSuji < PureSettei.banYokoHaba; iSuji++) { Masu ms = (Masu)(iDan * PureSettei.banYokoHaba + iSuji); Taikyokusya tai; if (PureMemory.gky_ky.yomiKy.yomiShogiban.yomiIbashoBan.ExistsKomaZenbu(ms, out tai)) { if (0 < space) { syuturyoku.Append(space.ToString()); space = 0; } Komasyurui ks; PureMemory.gky_ky.yomiKy.yomiShogiban.yomiIbashoBan.ExistsKoma(tai, ms, out ks); SpkKoma.AppendFenTo(f, Med_Koma.KomasyuruiAndTaikyokusyaToKoma(ks, tai), syuturyoku); } else { space++; } } if (0 < space) { syuturyoku.Append(space.ToString()); space = 0; } if (iDan + 1 < PureSettei.banTateHaba) { syuturyoku.Append("/"); } } } syuturyoku.Append(" "); // 持駒 if (PureMemory.gky_ky.yomiKy.yomiMotigomaItiran.IsEmpty()) { syuturyoku.Append("-"); } else { for (int iMk = 0; iMk < Conv_Motigoma.itiran.Length; iMk++) { int cnt = PureMemory.gky_ky.yomiKy.yomiMotigomaItiran.Count((Motigoma)iMk); if (0 < cnt) { syuturyoku.Append( cnt == 1 ? SpkMotiKoma.GetFen(f, (Motigoma)iMk)// 1個の時は数字は付かないぜ☆(^~^) : cnt.ToString() + SpkMotiKoma.GetFen(f, (Motigoma)iMk) ); } } } // 手番 syuturyoku.Append(" "); syuturyoku.Append(SpkTaikyokusya.ToFen(f, PureMemory.kifu_teban)); //// moves //if (syuturyokuMoves) //{ //} }