示例#1
0
 public static void AppendLine_Data_Kyokumen(Kyokumen ky, int dan, StringBuilder syuturyoku)
 {
     syuturyoku.Append("│");
     for (int iMs_offset = 0; iMs_offset < Option_Application.Optionlist.BanYokoHaba; iMs_offset++)
     {
         Masu ms = (Masu)(dan * Option_Application.Optionlist.BanYokoHaba + iMs_offset);
         Koma km = ky.GetBanjoKoma(ms);
         Conv_Koma.Setumei(km, syuturyoku);
         syuturyoku.Append("│");
     }
     syuturyoku.AppendLine();
 }
示例#2
0
 static Med_Koma()
 {
     komasyuruiNamaeItiran = new string[Conv_Taikyokusya.AllOptionalPhaseList.Length][];
     for (int iTai = 0; iTai < Conv_Taikyokusya.AllOptionalPhaseList.Length; iTai++)
     {
         komasyuruiNamaeItiran[iTai] = new string[Conv_Komasyurui.Itiran.Length];
         int iKs = 0;
         foreach (Koma km in Conv_Koma.ItiranTai[(int)iTai])
         {
             komasyuruiNamaeItiran[iTai][iKs] = Conv_Koma.GetName(km);
             iKs++;
         }
     }
 }
示例#3
0
        /// <summary>
        /// 差分更新は、対局者1 の視点の盤で行えなんだぜ☆(^▽^)
        /// </summary>
        /// <param name="ky"></param>
        /// <param name="km"></param>
        /// <param name="ms"></param>
        /// <param name="fueta"></param>
        public void FuyasuBanjoKoma(Kyokumen ky, Koma km, Masu ms)
        {
            if (DebugOptions.AddPiecesOnBoard)
            {
                var optionalPiece = OptionalPiece.From(km);

                Debug.Assert(Conv_Koma.IsOk(optionalPiece), "");//空白とか禁止☆(^~^)!

                Util_NikomaKankei.MakeKoumokuBangoHairetu_Subete(ky, Util_NikomaKankei.KoumokuBangoHairetu1);

                Increase(
                    Util_NikomaKankei.Kazoeru_NikomaKankeiHyokati_ItiTaiTa_SabunKosinYou(ky,
                                                                                         Util_NikomaKankei.GetKoumokuBango_Banjo(ky, km, ms),// 駒の位置(評価関数の項目番号)をリストに入れておくぜ☆
                                                                                         Util_NikomaKankei.KoumokuBangoHairetu1
                                                                                         ));
            }
        }
示例#4
0
        /// <summary>
        /// 駒の利き数☆(^~^)
        /// </summary>
        /// <returns></returns>
        public static void HyojiKomanoKikiSu(Shogiban shogiban, StringBuilder syuturyoku)
        {
            //, KikisuKomabetuCountboardItiran kikiKomabetuCB
            // KikisuZenbuCountboardItiran kikiZenbuCB

            syuturyoku.AppendLine("重ね利き数全部");
            // 対局者別 全部
            {
                // 見出し
                Setumei_Headers(Conv_Taikyokusya.NamaeItiran, syuturyoku);

                Util_Information.AppendLine_Top_Kyokumen(Conv_Taikyokusya.AllOptionalPhaseList.Length, syuturyoku); // ┌──┬──┬──┐みたいな線☆
                for (int dan = 0; dan < Option_Application.Optionlist.BanTateHaba; dan++)
                {
                    AppendLine_Data_Countboard(shogiban, dan * Option_Application.Optionlist.BanYokoHaba, syuturyoku);

                    if (dan + 1 < Option_Application.Optionlist.BanTateHaba)
                    {
                        Util_Information.AppendLine_Middle(Conv_Taikyokusya.AllOptionalPhaseList.Length, syuturyoku); // ├──┼──┼──┤みたいな線☆
                    }
                }
                Util_Information.AppendLine_Bottom(Conv_Taikyokusya.AllOptionalPhaseList.Length, syuturyoku); // └──┴──┴──┘みたいな線☆
            }
            // 駒別
            foreach (var optionalPhase29 in Conv_Taikyokusya.AllOptionalPhaseList) // 対局者1、対局者2
            {
                foreach (Koma km in Conv_Koma.ItiranTai[OptionalPhase.IndexOf(optionalPhase29)])
                {
                    syuturyoku.Append(Util_Information.FormatBanWidthZenkaku(Conv_Koma.GetName(km)));
                }
                syuturyoku.AppendLine();

                Util_Information.AppendLine_Top_Kyokumen(Conv_Komasyurui.Itiran.Length, syuturyoku);

                for (int dan = 0; dan < Option_Application.Optionlist.BanTateHaba; dan++)
                {
                    AppendLine_Data_Countboard(optionalPhase29, shogiban, dan * Option_Application.Optionlist.BanYokoHaba, syuturyoku);

                    if (dan + 1 < Option_Application.Optionlist.BanTateHaba)
                    {
                        Util_Information.AppendLine_Middle(Conv_Komasyurui.Itiran.Length, syuturyoku);
                    }
                }
                Util_Information.AppendLine_Bottom(Conv_Komasyurui.Itiran.Length, syuturyoku);
            }
        }
示例#5
0
        /// <summary>
        /// 駒の居場所
        /// </summary>
        /// <param name="syuturyoku"></param>
        public static void HyojiKomanoIbasho(Shogiban shogiban, StringBuilder syuturyoku)
        {
            //IbasyoKomabetuBitboardItiran bb_koma,
            //  KomaZenbuIbasyoBitboardItiran bb_komaZenbu
            syuturyoku.AppendLine("駒の居場所");

            // 駒全部☆
            {
                Setumei_Bitboards(new string[] { "対局者1", "対局者2" },
                                  new Bitboard[] {
                    shogiban.GetBBKomaZenbu(OptionalPhase.Black),
                    shogiban.GetBBKomaZenbu(OptionalPhase.White)
                }, syuturyoku);
                syuturyoku.AppendLine();
            }

            foreach (var optionalPhase81 in Conv_Taikyokusya.AllOptionalPhaseList)// 対局者1、対局者2
            {
                // 見出し
                foreach (Koma km in Conv_Koma.ItiranTai[OptionalPhase.IndexOf(optionalPhase81)])
                {
                    syuturyoku.Append(FormatBanWidthZenkaku(Conv_Koma.GetName(km)));
                }
                syuturyoku.AppendLine();

                // 盤
                Bitboard[] bbHairetu = new Bitboard[Conv_Komasyurui.Itiran.Length];
                int        i         = 0;
                foreach (Komasyurui ks in Conv_Komasyurui.Itiran)
                {
                    bbHairetu[i] = shogiban.GetBBKoma(Med_Koma.KomasyuruiAndTaikyokusyaToKoma(ks, optionalPhase81));
                    i++;
                }
                Setumei_Bitboards(bbHairetu, syuturyoku);
            }
        }
示例#6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="ms">どの(0~80)升に</param>
        /// <param name="km">先後付きの駒</param>
        /// <returns></returns>
        public static ulong GetBanjoKey(Masu ms, Koma km, Kyokumen.Sindanyo kys)
        {
            var optionalPiece = OptionalPiece.From(km);

            Debug.Assert(Conv_Koma.IsOk(optionalPiece), "");

            if (Dirty)
            {
                Tukurinaosi(kys);
            }

            if (!Conv_Koma.IsOk(optionalPiece))
            {
                throw new Exception("エラー☆(>_<) 盤上の駒じゃないぜ☆");
            }
            else if (kys.IsBanjo(ms))
            {
                return(m_banjoKeys_[(int)ms, (int)km]);
            }
            else
            {
                throw new Exception("エラー☆(>_<) 盤上のどこに置いてある駒なんだぜ☆");
            }
        }