示例#1
0
        public static void Kiki(bool isSfen, string commandline, Kyokumen ky, out Masu out_ms, out Bitboard out_kikiBB)
        {
            //KomanoUgokikata komanoUgokikata,

            // うしろに続く文字は☆(^▽^)
            int caret = 0;

            Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "kiki ");
            string line = commandline.Substring(caret).TrimEnd();

            if (line.Length == 2)// kiki b3
            {
                out_kikiBB = null;

                // 升を返すぜ☆
                if (!Med_Parser.TryParseMs(isSfen, commandline, ky, ref caret, out out_ms))
                {
                    throw new Exception("パースエラー102");
                }
            }
            else// kiki b3 R 1
            {
                out_ms = ky.MASU_ERROR;

                // 盤面表示を返すぜ☆
                string moji1 = "";
                string moji2 = "";
                string moji3 = "";
                string moji4 = "";
                Match  m     = Itiran_FenParser.GetKikiCommandPattern(Option_Application.Optionlist.USI).Match(commandline, caret);
                if (m.Success)
                {
                    Util_String.SkipMatch(commandline, ref caret, m);

                    moji1 = m.Groups[1].Value;
                    moji2 = m.Groups[2].Value;
                    moji3 = m.Groups[3].Value;
                    moji4 = m.Groups[4].Value;

                    if (!Med_Parser.TryTaikyokusya(Option_Application.Optionlist.USI, moji4, out Option <Phase> phase))
                    {
                        throw new Exception($"対局者のパースエラー moji4=[{ moji4 }]");
                    }
                    out_kikiBB = Util_Application.Kiki_BB(Med_Koma.KomasyuruiAndTaikyokusyaToKoma(Med_Parser.Moji_Komasyurui(Option_Application.Optionlist.USI, moji3), phase), Med_Parser.FenSujiDan_Masu(Option_Application.Optionlist.USI, moji1, moji2), ky.Shogiban);// komanoUgokikata
                }
                else
                {
                    out_kikiBB = null;
                }
            }
        }
示例#2
0
 public static void FlushAll1(StringBuilder syuturyoku)
 {
     // 保存間隔調整をしていて、保存をスルーすることはあるぜ☆(^~^)
     if (Util_Application.IsOk_SavefileTimeSpan())
     {
         Util_Machine.Flush_Joseki(syuturyoku);  // 定跡ファイルを更新するぜ☆(^~^)
         Util_Machine.Flush_Seiseki(syuturyoku); // 成績ファイルを更新するぜ☆(^~^)
         if (Option_Application.Optionlist.Learn)
         {
             Util_Machine.Flush_Nikoma(syuturyoku);   // 二駒関係ファイルを更新するぜ☆(^~^)
         }
         Util_Application.Restart_SavefileTimeSpan(); // 保存間隔の再調整だぜ☆(^▽^)
     }
 }
示例#3
0
        /// <summary>
        /// 定跡更新(ゲームセクション内)
        /// </summary>
        public static void Update1_JosekiToroku(Move inputMove, Kyokumen ky, StringBuilder syuturyoku)
        {
            if (Util_Machine.IsEnableBoardSize() && Option_Application.Optionlist.JosekiRec)
            {
                Util_Application.Hyoka(ky, out HyokatiUtiwake hyokatiUtiwake, HyokaRiyu.Yososu, true//ランダムな局面の可能性もあるぜ☆(^~^)
                                       );

                // 定跡更新☆(^▽^)
                Option_Application.Joseki.AddMove(KyFen_before, KyHash_before, OptionalPhaseBeforeMove, inputMove,
                                                  hyokatiUtiwake.EdaBest, // 指した直後の局面の点数
                                                  1,                      //人間は1手読み扱いで☆
                                                  Util_Application.VERSION,
                                                  syuturyoku
                                                  );
            }
        }
示例#4
0
        /// <summary>
        /// 終局後に棋譜を作る場合☆(^~^)感想戦用だぜ☆(^▽^)
        ///
        /// ・成績
        ///
        /// の作成も混ざっている☆(^~^)
        /// </summary>
        public static void TukuruKifu(bool isSfen, Kyokumen ky, StringBuilder syuturyoku)
        {
            // 指した後の手☆(成績 登録用)
            Move ss_after = Move.Toryo; // 未使用時の初期値

            // 決着から初期局面まで、逆順で戻しながら棋譜を記録するぜ☆(^▽^)
            int fukasa = 0;

            while (null != ky.Konoteme.Ittemae)                                 //アンドゥできなくなるまで戻すぜ☆(^▽^)
            {
                ss_after = ky.Konoteme.Move;                                    // アンドゥする前に指し手を残しておくぜ☆(^▽^)
                Option_Application.Kifu.AddFirst(ss_after);
                ky.UndoMove(isSfen, ss_after, syuturyoku);                      // 指し手を頼りにアンドゥするぜ☆(^▽^)
                Util_Application.InLoop_SeisekiKosin(ss_after, ky, syuturyoku); // 成績更新☆(^▽^)
                fukasa++;
            }
        }
示例#5
0
        public static void InLoop_SeisekiKosin(Move ss_after, Kyokumen ky, StringBuilder syuturyoku)
        {
            if (Option_Application.Optionlist.SeisekiRec)// 今回指した手全てに、成績を付けたいぜ☆(^~^)
            {
                int teme = ky.Konoteme.ScanNantemadeBango();
                if (Util_Taikyoku.PNNantedume_Teme[OptionalPhase.IndexOf(ky.CurrentOptionalPhase)] <= teme)
                {
                    // 何手詰め、何手詰められ の表記が出て以降の成績を記録するぜ☆(^~^)

                    // 一手前の局面と、指したあとの指し手で成績更新☆(^▽^)
                    Conv_Seiseki.ResultToCount(ky.CurrentOptionalPhase, Util_Application.Result(ky), out int kati, out int hikiwake, out int make);

                    StringBuilder kyMojiretu = new StringBuilder();
                    ky.AppendFenTo(Option_Application.Optionlist.USI, kyMojiretu);
                    Option_Application.Seiseki.AddMove(
                        kyMojiretu.ToString(),
                        ky.KyokumenHash.Value,
                        ky.CurrentOptionalPhase,
                        ss_after,
                        Util_Application.VERSION,
                        kati,
                        hikiwake,
                        make
                        );
                    syuturyoku.Append("|");
                    Logger.Flush(syuturyoku.ToString());
                    syuturyoku.Clear();
                }
                else
                {
                    syuturyoku.Append(".");
                    Logger.Flush(syuturyoku.ToString());
                    syuturyoku.Clear();
                }
            }//成績の記録☆
        }
示例#6
0
 /// <summary>
 /// アプリケーション終了時に呼び出せだぜ☆(^▽^)!
 /// </summary>
 public static void OnApplicationFinished(StringBuilder syuturyoku)
 {
     Util_Application.End_Application(syuturyoku);
 }
示例#7
0
        public static void Set(string commandline, Kyokumen ky, StringBuilder syuturyoku)
        {
            int caret = 0;

            Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "set ");
            // うしろに続く文字は☆(^▽^)

            #region AspirationWindow
            if (caret == commandline.IndexOf("AspirationFukasa ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "AspirationFukasa ");
                string line = commandline.Substring(caret);

                if (int.TryParse(line, out int val))
                {
                    Option_Application.Optionlist.AspirationFukasa = val;
                }
            }
            #endregion
            #region AspirationWindow
            if (caret == commandline.IndexOf("AspirationWindow ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "AspirationWindow ");
                string line = commandline.Substring(caret);

                if (int.TryParse(line, out int val))
                {
                    if (val < 0)
                    {
                        val = -val;
                    }
                    else if ((int)Hyokati.TumeTesu_SeiNoSu_ReiTeDume < val)
                    {
                        val = (int)Hyokati.TumeTesu_SeiNoSu_ReiTeDume;
                    }
                    Option_Application.Optionlist.AspirationWindow = (Hyokati)val;
                }
            }
            #endregion
            #region BanTateHaba
            else if (caret == commandline.IndexOf("BanTateHaba ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "BanTateHaba ");
                string line = commandline.Substring(caret);

                if (int.TryParse(line, out int val))
                {
                    Option_Application.Optionlist.BanTateHabaOld = Option_Application.Optionlist.BanTateHaba;
                    Option_Application.Optionlist.BanTateHaba    = val;
                    ky.Tekiyo(true, syuturyoku);
                }
            }
            #endregion
            #region BanYokoHaba
            else if (caret == commandline.IndexOf("BanYokoHaba ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "BanYokoHaba ");
                string line = commandline.Substring(caret);

                if (int.TryParse(line, out int val))
                {
                    Option_Application.Optionlist.BanYokoHabaOld = Option_Application.Optionlist.BanYokoHaba;
                    Option_Application.Optionlist.BanYokoHaba    = val;
                    ky.Tekiyo(true, syuturyoku);
                }
            }
            #endregion

            #region BetaCutPer
            else if (caret == commandline.IndexOf("BetaCutPer ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "BetaCutPer ");
                string line = commandline.Substring(caret);

                if (int.TryParse(line, out int val))
                {
                    if (val < 0)
                    {
                        val = 0;
                    }
                    else if (100 < val)
                    {
                        val = 100;
                    }
                    Option_Application.Optionlist.BetaCutPer = val;
                }
            }
            #endregion
            #region HanpukuSinkaTansakuTukau
            else if (caret == commandline.IndexOf("HanpukuSinkaTansakuTukau ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "HanpukuSinkaTansakuTukau ");
                string line = commandline.Substring(caret);

                if (bool.TryParse(line, out bool val))
                {
                    Option_Application.Optionlist.HanpukuSinkaTansakuTukau = val;
                }
            }
            #endregion
            #region JohoJikan
            else if (caret == commandline.IndexOf("JohoJikan ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "JohoJikan ");
                string line = commandline.Substring(caret);

                if (int.TryParse(line, out int val))
                {
                    Option_Application.Optionlist.JohoJikan = val;
                }
            }
            #endregion
            #region JosekiPer
            else if (caret == commandline.IndexOf("JosekiPer ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "JosekiPer ");
                string line = commandline.Substring(caret);

                if (int.TryParse(line, out int val))
                {
                    if (val < 0)
                    {
                        val = 0;
                    }
                    else if (100 < val)
                    {
                        val = 100;
                    }
                    Option_Application.Optionlist.JosekiPer = val;
                }
            }
            #endregion
            #region JosekiRec
            else if (caret == commandline.IndexOf("JosekiRec ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "JosekiRec ");
                string line = commandline.Substring(caret);

                if (bool.TryParse(line, out bool val))
                {
                    Option_Application.Optionlist.JosekiRec = val;
                }
            }
            #endregion
            #region Learn
            else if (caret == commandline.IndexOf("Learn ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "Learn ");
                string line = commandline.Substring(caret);

                if (bool.TryParse(line, out bool val))
                {
                    Option_Application.Optionlist.Learn = val;
                }
            }
            #endregion
            #region NikomaHyokaKeisu
            else if (caret == commandline.IndexOf("NikomaHyokaKeisu ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "NikomaHyokaKeisu ");
                string line = commandline.Substring(caret);

                if (double.TryParse(line, out double val))
                {
                    Option_Application.Optionlist.NikomaHyokaKeisu = val;
                }
            }
            #endregion
            #region NikomaGakusyuKeisu
            else if (caret == commandline.IndexOf("NikomaGakusyuKeisu ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "NikomaGakusyuKeisu ");
                string line = commandline.Substring(caret);

                if (double.TryParse(line, out double val))
                {
                    Option_Application.Optionlist.NikomaGakusyuKeisu = val;
                }
            }
            #endregion
            // P1Char
            else if (caret == commandline.IndexOf("P1Char ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "P1Char ");
                Option_Application.Optionlist.PNChar[(int)Phase.Black] = AbstractConvMoveCharacter.Parse(commandline, ref caret);
            }
            #region P1Com
            else if (caret == commandline.IndexOf("P1Com ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "P1Com ");
                string line = commandline.Substring(caret);

                if (bool.TryParse(line, out bool val))
                {
                    Option_Application.Optionlist.P1Com = val;
                }
            }
            #endregion
            // P1Name
            else if (caret == commandline.IndexOf("P1Name ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "P1Name ");
                Option_Application.Optionlist.PNName[(int)Phase.Black] = commandline.Substring(caret);
            }
            else if (caret == commandline.IndexOf("P2Char ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "P2Char ");
                Option_Application.Optionlist.PNChar[(int)Phase.White] = AbstractConvMoveCharacter.Parse(commandline, ref caret);
            }
            #region P2Com
            else if (caret == commandline.IndexOf("P2Com ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "P2Com ");
                string line = commandline.Substring(caret);

                if (bool.TryParse(line, out bool val))
                {
                    Option_Application.Optionlist.P2Com = val;
                }
            }
            #endregion
            // P2Name
            else if (caret == commandline.IndexOf("P2Name ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "P2Name ");
                Option_Application.Optionlist.PNName[(int)Phase.White] = commandline.Substring(caret);
            }
            // RandomCharacter
            else if (caret == commandline.IndexOf("RandomCharacter ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "RandomCharacter ");
                string line = commandline.Substring(caret);

                if (bool.TryParse(line, out bool val))
                {
                    Option_Application.Optionlist.RandomCharacter = val;
                }
            }
            #region RandomNikoma
            else if (caret == commandline.IndexOf("RandomNikoma ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "RandomNikoma ");
                string line = commandline.Substring(caret);

                if (bool.TryParse(line, out bool val))
                {
                    Option_Application.Optionlist.RandomNikoma = val;
                }
            }
            #endregion
            // RandomSei は 廃止されたぜ☆(^▽^)www
            #region RandomStart
            else if (caret == commandline.IndexOf("RandomStart ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "RandomStart ");
                string line = commandline.Substring(caret);

                if (bool.TryParse(line, out bool val))
                {
                    Option_Application.Optionlist.RandomStart = val;
                }
            }
            #endregion
            #region RandomStartTaikyokusya
            else if (caret == commandline.IndexOf("RandomStartTaikyokusya ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "RandomStartTaikyokusya ");
                string line = commandline.Substring(caret);

                if (bool.TryParse(line, out bool val))
                {
                    Option_Application.Optionlist.RandomStartTaikyokusya = val;
                }
            }
            #endregion
            #region RenzokuRandomRule
            else if (caret == commandline.IndexOf("RenzokuRandomRule ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "RenzokuRandomRule ");
                string line = commandline.Substring(caret);

                if (bool.TryParse(line, out bool val))
                {
                    Option_Application.Optionlist.RenzokuRandomRule = val;
                }
            }
            #endregion
            #region RenzokuTaikyoku
            else if (caret == commandline.IndexOf("RenzokuTaikyoku ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "RenzokuTaikyoku ");
                string line = commandline.Substring(caret);

                if (bool.TryParse(line, out bool val))
                {
                    Option_Application.Optionlist.RenzokuTaikyoku = val;
                }
            }
            #endregion
            #region SagareruHiyoko
            else if (caret == commandline.IndexOf("SagareruHiyoko ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "SagareruHiyoko ");
                string line = commandline.Substring(caret);

                if (bool.TryParse(line, out bool val))
                {
                    // #仲ルール
                    if (
                        (!Option_Application.Optionlist.SagareruHiyoko && val) // さがれるひよこ モードにチェンジ☆
                        ||
                        (Option_Application.Optionlist.SagareruHiyoko && !val) // 普通のひよこ モードにチェンジ☆
                        )
                    {
                        Util_Machine.Flush_Joseki(syuturyoku);  // 定跡を書き出し(あとで読込むので、書き込み強制)
                        Util_Machine.Flush_Seiseki(syuturyoku); // 成績を書き出し(あとで読込むので、書き込み強制)
                        if (Option_Application.Optionlist.Learn)
                        {
                            Util_Machine.Flush_Nikoma(syuturyoku);   // 二駒関係を書き出し(あとで読込むので、書き込み強制)
                        }
                        Util_Application.Restart_SavefileTimeSpan(); // 保存間隔の再調整だぜ☆(^▽^)

                        // フラグ変更☆
                        Option_Application.Optionlist.SagareruHiyoko = val;

                        // 駒の動き方を作り直し
                        ky.Shogiban.Tukurinaosi_1_Clear_KomanoUgokikata(ky.Sindan.MASU_YOSOSU);
                        ky.Shogiban.Tukurinaosi_2_Input_KomanoUgokikata(ky.Sindan);

                        // 二駒関係の評価値を作り直し
                        //Util_NikomaKankei.Parameters = Util_NikomaKankei.CreateParameters();

                        Util_Machine.Load_Joseki(syuturyoku);  // 定跡を読込み
                        Util_Machine.Load_Seiseki(syuturyoku); // 成績を読込み
                        Util_Machine.Load_Nikoma(syuturyoku);  // 二駒関係を読込み
                    }
                    else
                    {
                        Option_Application.Optionlist.SagareruHiyoko = val;
                    }
                }
            }
            #endregion
            #region SaidaiEda
            else if (caret == commandline.IndexOf("SaidaiEda ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "SaidaiEda ");
                string line = commandline.Substring(caret);

                if (int.TryParse(line, out int val))
                {
                    Option_Application.Optionlist.SaidaiEda = val;
                }
            }
            #endregion
            #region SaidaiFukasa
            else if (caret == commandline.IndexOf("SaidaiFukasa ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "SaidaiFukasa ");
                string line = commandline.Substring(caret);

                if (int.TryParse(line, out int val))
                {
                    Option_Application.Optionlist.SaidaiFukasa = val;

                    if (AbstractUtilMoveGen.SAIDAI_SASITE_FUKASA - 1 < Option_Application.Optionlist.SaidaiFukasa)
                    {
                        Option_Application.Optionlist.SaidaiFukasa = AbstractUtilMoveGen.SAIDAI_SASITE_FUKASA - 1;
                        syuturyoku.AppendLine($"(^q^)実装の上限の [{ (AbstractUtilMoveGen.SAIDAI_SASITE_FUKASA - 1) }] に下げたぜ☆");
                    }
                }
            }
            #endregion
            #region SeisekiRec
            else if (caret == commandline.IndexOf("SeisekiRec ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "SeisekiRec ");
                string line = commandline.Substring(caret);

                if (bool.TryParse(line, out bool val))
                {
                    Option_Application.Optionlist.SeisekiRec = val;
                }
            }
            #endregion
            #region SennititeKaihi
            else if (caret == commandline.IndexOf("SennititeKaihi ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "SennititeKaihi ");
                string line = commandline.Substring(caret);

                if (bool.TryParse(line, out bool val))
                {
                    Option_Application.Optionlist.SennititeKaihi = val;
                }
            }
            #endregion
            #region SikoJikan
            else if (caret == commandline.IndexOf("SikoJikan ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "SikoJikan ");
                string line = commandline.Substring(caret);

                if (long.TryParse(line, out long val))
                {
                    Option_Application.Optionlist.SikoJikan = val;
                }
            }
            #endregion
            #region SikoJikanRandom
            else if (caret == commandline.IndexOf("SikoJikanRandom ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "SikoJikanRandom ");
                string line = commandline.Substring(caret);

                if (int.TryParse(line, out int val))
                {
                    Option_Application.Optionlist.SikoJikanRandom = val;
                }
            }
            #endregion
            #region TranspositionTableTukau
            else if (caret == commandline.IndexOf("TranspositionTableTukau ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "TranspositionTableTukau ");
                string line = commandline.Substring(caret);

                if (bool.TryParse(line, out bool val))
                {
                    Option_Application.Optionlist.TranspositionTableTukau = val;
                }
            }
            #endregion
            #region UseTimeOver
            else if (caret == commandline.IndexOf("UseTimeOver ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "UseTimeOver ");
                string line = commandline.Substring(caret);

                if (bool.TryParse(line, out bool val))
                {
                    Option_Application.Optionlist.UseTimeOver = val;
                }
            }
            #endregion
            #region USI
            else if (caret == commandline.IndexOf("USI ", caret))
            {
                // うしろに続く文字は☆(^▽^)
                Util_String.TobasuTangoToMatubiKuhaku(commandline, ref caret, "USI ");
                string line = commandline.Substring(caret);

                if (bool.TryParse(line, out bool val))
                {
                    Option_Application.Optionlist.USI = val;
                }
            }
            #endregion

            // 該当しないものは無視だぜ☆(^▽^)
        }
示例#8
0
        /// <summary>
        /// 対局終了
        /// </summary>
        public static void DoTejun5_SyuryoTaikyoku1(IPlaying playing, Kyokumen ky, StringBuilder syuturyoku)
        {
            // 表示(コンソール・ゲーム用)
            {
                playing.Result(ky, syuturyoku, CommandMode.NingenYoConsoleGame);
                syuturyoku.AppendLine("終わったぜ☆(^▽^)");
                Logger.Flush(syuturyoku.ToString());
                syuturyoku.Clear();
            }

            Util_Application.Begin_SeisekiKosin(syuturyoku);

            // 決着から初期局面まで、逆順で戻しながら棋譜を記録するぜ☆(^▽^)
            Med_Kyokumen.TukuruKifu(Option_Application.Optionlist.USI, ky, syuturyoku);

            // 棋譜の初期局面を更新☆
            {
                StringBuilder kyFen_temp = new StringBuilder();
                ky.AppendFenTo(Option_Application.Optionlist.USI, kyFen_temp);
                Option_Application.Kifu.SyokiKyokumenFen = kyFen_temp.ToString();
            }

            Util_Application.End_SeisekiKosin(syuturyoku);
            string kigoComment = "";

            // TODO: 成績は保存しないにしても、棋譜は欲しいときもあるぜ☆(^~^)
            // 棋譜を作ろうぜ☆
            syuturyoku.AppendLine($@"{kigoComment}感想戦を行う場合は kansosen と打てだぜ☆(^▽^) そのあと kifu 1 とか打て☆(^▽^)
{kigoComment}終わるときは hirate な☆(^▽^)");
            Logger.Flush(syuturyoku.ToString());
            syuturyoku.Clear();

            // 保存していないものを保存だぜ☆(^▽^)
            Util_Application.FlushAll1(syuturyoku);

            // 初期局面に戻すぜ☆(^▽^)
            Util_Taikyoku.Clear();
            Util_Application.ResetHirate(Option_Application.Optionlist.USI, ky, syuturyoku);
            if (Option_Application.Optionlist.RandomStart)
            {
                playing.Ky(Option_Application.Optionlist.USI, "ky mazeru", ky, syuturyoku);
            }

            if (Option_Application.Optionlist.RandomStartTaikyokusya)
            {
                playing.Taikyokusya_cmd("taikyokusya mazeru", ky, syuturyoku);
            }

            if (Util_Machine.IsRenzokuTaikyokuStop())
            {
                // 連続対局を止めるぜ☆(^▽^)
                Option_Application.Optionlist.RenzokuTaikyoku = false;
                syuturyoku.AppendLine($"{Logger.RenzokuTaikyokuStopFile }> done");
            }

            if (!Option_Application.Optionlist.RenzokuTaikyoku)
            {
                // ゲームモードを解除するぜ☆(^~^)
                if (GameMode.Game == Util_Application.GameMode)// 感想戦での発動防止☆
                {
                    Util_Application.GameMode = GameMode.Karappo;
                }
            }
            else
            {
                // 連続対局中☆(^~^)

                if (Option_Application.Optionlist.RenzokuRandomRule && // 連続対局中、ルールをランダムに変える設定で
                    0 == Option_Application.Random.Next(2) &&          // ランダムに
                    Util_Application.IsTimeOver_RenzokuRandomRule()    // 変更間隔が空いているとき
                    )
                {
                    // ルールを変えるぜ☆(^▽^)
                    string commandline_2 = $"set SagareruHiyoko {!Option_Application.Optionlist.SagareruHiyoko}";
                    syuturyoku.AppendLine($"RenzokuRandomRule> {commandline_2}");
                    Logger.Flush(syuturyoku.ToString());
                    syuturyoku.Clear();

                    // 表示してから実行しようぜ☆(^~^)
                    Util_Application.Set(commandline_2, ky, syuturyoku);

                    Util_Application.Restart_RenzokuRandomRuleTimeSpan();// 変更間隔の再調整だぜ☆(^▽^)
                }
            }

            if (Option_Application.Optionlist.RandomCharacter)
            {
                // コンピューター対局者の性格は ころころ変えるぜ☆(^▽^)
                for (int iPhase = 0; iPhase < Conv_Taikyokusya.AllOptionalPhaseList.Length; iPhase++)
                {
                    Option_Application.Optionlist.PNChar[iPhase] = AbstractConvMoveCharacter.Items[Option_Application.Random.Next(AbstractConvMoveCharacter.Items.Length)];
                }
            }

            // コマンドの誤発動防止
            Util_Commandline.CommentCommandline();
        }