/// <summary> /// 駒別の居場所 /// </summary> /// <param name="hyoji"></param> static void AppendKomaBetuIbashoTo(IbashoBan.YomiIbashoBan yomiIbashoBan, StringBuilder hyoji) { hyoji.AppendLine("駒別の居場所"); foreach (Taikyokusya tai in Conv_Taikyokusya.itiran)// 対局者1、対局者2 { // 駒別 foreach (Piece km_tai in Conv_Koma.itiranTai[(int)tai]) { hyoji.Append(SpkBanWaku.CutHeaderBanWidthZenkaku(Conv_Koma.GetName(km_tai))); } hyoji.AppendLine(); // 盤 YomiBitboard[] bbHairetu = new YomiBitboard[Conv_Komasyurui.itiran.Length]; int i = 0; foreach (Komasyurui ks in Conv_Komasyurui.itiran) { bbHairetu[i] = yomiIbashoBan.GetKoma(Med_Koma.KomasyuruiAndTaikyokusyaToKoma(ks, tai)); i++; } SpkBan_MultiColumn.Setumei_Bitboard(null, bbHairetu, " 〇 ", " ", hyoji); } }
/// <summary> /// 駒の利き /// </summary> /// <param name="bbItiran_kikiZenbu"></param> /// <param name="bbItiran_kikiKomabetu"></param> /// <param name="hyoji"></param> public static void HyojiKomanoKiki(KikiBan.YomiKikiBan yomiKikiBan, StringBuilder hyoji) { Debug.Assert(yomiKikiBan.IsActiveBBKiki(), ""); // 対局者別 { hyoji.AppendLine("利き(対局者別)"); YomiBitboard[] bbHairetu = new YomiBitboard[Conv_Taikyokusya.itiran.Length]; foreach (Taikyokusya tai in Conv_Taikyokusya.itiran) { bbHairetu[(int)tai] = new YomiBitboard(yomiKikiBan.CloneBBKikiZenbu(tai)); } SpkBan_MultiColumn.Setumei_Bitboard(Conv_Taikyokusya.namaeItiran, bbHairetu, " + ", " ", hyoji); } // 駒別 { hyoji.AppendLine("利き(駒別)"); foreach (Taikyokusya tai in Conv_Taikyokusya.itiran)// 対局者1、対局者2 { // 盤上 YomiBitboard[] bbHairetu = new YomiBitboard[Conv_Komasyurui.itiran.Length]; foreach (Komasyurui ks in Conv_Komasyurui.itiran) { bbHairetu[(int)ks] = new YomiBitboard(yomiKikiBan.CloneBBKiki(Med_Koma.KomasyuruiAndTaikyokusyaToKoma(ks, tai))); } SpkBan_MultiColumn.Setumei_Bitboard(Med_Koma.GetKomasyuruiNamaeItiran(tai), bbHairetu, " + ", " ", hyoji); } } }
/// <summary> /// 将棋盤をコンソールへ出力するぜ☆(^▽^) /// ログに向いた、シンプルな表示☆ /// </summary> /// <returns></returns> public static void Setumei_Bitboard(string header, Bitboard bb, StringBuilder hyoji) { Debug.Assert(null != bb, ""); SpkBan_MultiColumn.Setumei_Bitboard(new string[] { header }, new YomiBitboard[] { new YomiBitboard(bb) }, " △ ", " ", hyoji); }
/// <summary> /// 利き /// </summary> /// <param name="yomiKy"></param> /// <param name="tai"></param> /// <param name="hyoji"></param> public static void Setumei_GenkoKiki(Taikyokusya tai, StringBuilder hyoji) { hyoji.AppendLine("利き:(現行)"); SpkBan_MultiColumn.Setumei_Bitboard( Med_Koma.GetKomasyuruiNamaeItiran(tai), PureMemory.gky_ky.yomiKy.yomiShogiban.yomiKikiBan.GetBB_WhereKiki(tai), " + ", " ", hyoji ); }
/// <summary> /// 居場所(対局者別ですべての駒) /// </summary> /// <param name="hyoji"></param> static void AppendKomaZenbuIbashoTo(string header, IbashoBan.YomiIbashoBan yomiIbashoBan, StringBuilder hyoji) { hyoji.AppendLine(string.Format("居場所(対局者別) {0}", header)); SpkBan_MultiColumn.Setumei_Bitboard( new string[] { "対局者1", "対局者2" }, new Bitboard[] { yomiIbashoBan.CloneKomaZenbu(Taikyokusya.T1), //.GetKomaZenbu(Taikyokusya.T1) yomiIbashoBan.CloneKomaZenbu(Taikyokusya.T2) //GetKomaZenbu(Taikyokusya.T2) }, hyoji); hyoji.AppendLine(); }
/// <summary> /// 駒の動き☆ /// </summary> /// <param name="komanoUgokikata"></param> /// <param name="hyoji"></param> public static void HyojiKomanoUgoki(KikiBan.YomiKikiBan yomiKikiBan, int masuYososu, StringBuilder hyoji) { for (int ms = 0; ms < masuYososu; ms++) { hyoji.AppendLine($"ます{ ms}"); foreach (Taikyokusya tai in Conv_Taikyokusya.itiran) { // 盤上 YomiBitboard[] bbHairetu = new YomiBitboard[Conv_Komasyurui.itiran.Length]; foreach (Komasyurui ks in Conv_Komasyurui.itiran) { bbHairetu[(int)ks] = new YomiBitboard(BitboardsOmatome.KomanoUgokikataYk00.Clone_Merge( Med_Koma.KomasyuruiAndTaikyokusyaToKoma(ks, tai), (Masu)ms)); } SpkBan_MultiColumn.Setumei_Bitboard(Med_Koma.GetKomasyuruiNamaeItiran(tai), bbHairetu, " + ", " ", hyoji); hyoji.AppendLine(); } } }