Пример #1
0
 public static void ReadCommandline(StringBuilder syuturyoku)
 {
     Logger.Flush(syuturyoku.ToString());
     syuturyoku.Clear();
     Util_Commandline.SetCommandline(Util_Machine.ReadLine());
     syuturyoku.AppendLine(Util_Commandline.Commandline);
     Logger.Flush_NoEcho(syuturyoku.ToString());
     syuturyoku.Clear();
 }
Пример #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 Init_JosekiToroku(Kyokumen ky)
 {
     IsJosekiTraced          = false;//毎回リセット☆(^▽^)
     KyFen_before            = null;
     KyHash_before           = 0;
     OptionalPhaseBeforeMove = Option <Phase> .None;
     if (Util_Machine.IsEnableBoardSize() && Option_Application.Optionlist.JosekiRec)
     {
         StringBuilder fenMojiretu = new StringBuilder();
         ky.AppendFenTo(Option_Application.Optionlist.USI, fenMojiretu);
         KyFen_before            = fenMojiretu.ToString();
         KyHash_before           = ky.KyokumenHash.Value;
         OptionalPhaseBeforeMove = ky.CurrentOptionalPhase;
     }
 }
Пример #4
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
                                                  );
            }
        }
Пример #5
0
        /// <summary>
        /// 定跡更新(ゲームセクション内)
        /// </summary>
        public static void Update2_JosekiToroku(Move bestMove, Hyokati bestHyokati, Kyokumen ky, StringBuilder syuturyoku)
        {
            if (Util_Machine.IsEnableBoardSize() && Option_Application.Optionlist.JosekiRec)
            {
                if (!IsJosekiTraced)// 定跡を使った指し手ではない場合に限り
                {
#if DEBUG
                    // 指し手の整合性をチェックしておきたいぜ☆(^▽^)
                    {
                        Kyokumen ky_forAssert = new Kyokumen();
                        int      caret_2      = 0;
                        if (!ky_forAssert.ParsePositionvalue(Option_Application.Optionlist.USI, KyFen_before, ref caret_2, true, false, out string moves, syuturyoku)) // ビットボードを更新したいので、適用する
                        {
                            syuturyoku.AppendLine("パースに失敗だぜ☆(^~^)! #鯰");
                            var msg = syuturyoku.ToString();
                            syuturyoku.Clear();
                            Logger.Flush(msg);
                            throw new Exception(msg);
                        }

                        if (!ky_forAssert.CanDoMove(bestMove, out MoveMatigaiRiyu riyu))
                        {
                            StringBuilder reigai1 = new StringBuilder();
                            reigai1.AppendLine("指せない指し手を定跡に登録しようとしたぜ☆(^~^)!:");
                            // reigai1.Append("理由:"); ConvMove.SetumeiLine(riyu, reigai1);
                            reigai1.Append("指し手:"); ConvMove.SetumeiLine(Option_Application.Optionlist.USI, bestMove, reigai1);
                            reigai1.Append("定跡にする1手前の局面 ("); reigai1.Append(KyFen_before); reigai1.AppendLine(")");
                            Util_Information.Setumei_Lines_Kyokumen(ky_forAssert, reigai1);
                            reigai1.AppendLine();
                            reigai1.Append("1手後は、現局面");
                            Util_Information.Setumei_Lines_Kyokumen(ky, reigai1);
                            syuturyoku.AppendLine(reigai1.ToString());
                            var msg = syuturyoku.ToString();
                            syuturyoku.Clear();
                            Logger.Flush(msg);
                            throw new Exception(msg);
                        }
                    }
#endif

                    Option_Application.Joseki.AddMove(KyFen_before, KyHash_before, OptionalPhaseBeforeMove, bestMove, bestHyokati, Util_Tansaku.NekkoKaranoFukasa, Util_Application.VERSION, syuturyoku);
                }
            }
        }
Пример #6
0
        public static void DoTejun7_FlushAll2(StringBuilder syuturyoku)
        {
            // 保存間隔を調整している外部ファイルがあれば強制保存だぜ☆(^▽^)
            {
                Util_Machine.Flush_Joseki(syuturyoku);  // 定跡を書き出し
                Util_Machine.Flush_Seiseki(syuturyoku); // 成績を書き出し
                if (Option_Application.Optionlist.Learn)
                {
                    Util_Machine.Flush_Nikoma(syuturyoku);// 二駒関係を書き出し
                }
            }

            // 表示・ログ出力(コンソール・ゲーム用)
            {
                // ファイルに書き出していないログが溜まっていれば、これで全部書き出します。
                Logger.Flush(syuturyoku.ToString());
                syuturyoku.Clear();
            }
        }
Пример #7
0
        /// <summary>
        /// 定跡を読込むぜ☆(^▽^)
        /// </summary>
        public static void Load_Joseki(StringBuilder syuturyoku)
        {
            if (IsEnableBoardSize())
            {
                {
                    syuturyoku.Append("定跡ファイル読込中");
                    var msg = syuturyoku.ToString();
                    syuturyoku.Clear();
                    Logger.Flush(msg);
                }

                // まず、既存ファイル名を列挙するぜ☆(^▽^)
                string   filenamePattern = $"_auto_joseki{(Option_Application.Optionlist.SagareruHiyoko ? Logger.LocalRuleSagareruHiyoko : Logger.LocalRuleHonshogi)}*";
                string[] filepaths       = Directory.GetFiles(".", filenamePattern);

                // どんどんマージしていくぜ☆(^▽^)
                Option_Application.Joseki.Clear();
                for (int index = 0; index < filepaths.Length; index++)
                {
                    syuturyoku.Append(".");
                    // これが重たいのは仕方ないぜ☆(^~^)
                    {
                        var msg = syuturyoku.ToString();
                        syuturyoku.Clear();
                        Logger.Flush(msg);
                    }

                    Joseki jo = Util_Machine.Load_Joseki_1file(filepaths[index], syuturyoku);
                    if (null != jo)
                    {
                        Option_Application.Joseki.Merge(jo, syuturyoku);
                    }
                }

                syuturyoku.AppendLine("☆");
                {
                    var msg = syuturyoku.ToString();
                    syuturyoku.Clear();
                    Logger.Flush(msg);
                }
            }
        }
Пример #8
0
        /// <summary>
        /// 成績を書き出すぜ☆(^▽^)
        /// </summary>
        public static void Flush_Seiseki(StringBuilder syuturyoku)
        {
            if (IsEnableBoardSize() && Option_Application.Optionlist.SeisekiRec && Option_Application.Seiseki.Edited)
            {
                syuturyoku.Append("成績ファイル書出中");
                {
                    var msg = syuturyoku.ToString();
                    syuturyoku.Clear();
                    Logger.Flush(msg);
                }

                // 容量がでかくなったので、複数のファイルに分割して保存するぜ☆(^▽^)
                Option_Application.Seiseki.Bunkatu(out Seiseki[] bunkatu, out string[] bunkatupartNames);

                // 残すべきファイル名一覧☆(^▽^)
                List <string> expectedFiles = new List <string>();
                {
                    foreach (string bunkatupartName in bunkatupartNames)
                    {
                        expectedFiles.Add($"_auto_seiseki{(Option_Application.Optionlist.SagareruHiyoko ? Logger.LocalRuleSagareruHiyoko : Logger.LocalRuleHonshogi)}{bunkatupartName}.txt");
                    }
                }

                // ファイル名パターンに合致しない定跡ファイルはゴミになるので削除するぜ☆(^~^)
                // バックアップを残したかったらファイル名の先頭を変えることだぜ☆(^▽^)
                List <string> removeFilepaths = new List <string>();
                {
                    // まず、既存ファイル名を列挙するぜ☆(^▽^)
                    string   filenamePattern = $"_auto_seiseki{ (Option_Application.Optionlist.SagareruHiyoko ? Logger.LocalRuleSagareruHiyoko : Logger.LocalRuleHonshogi) }*";
                    string[] filepaths       = Directory.GetFiles(".", filenamePattern);

                    foreach (string filepath in filepaths)
                    {
                        string filename = Path.GetFileName(filepath);
                        if (!expectedFiles.Contains(filename))
                        {
                            var msg = syuturyoku.ToString();
                            syuturyoku.Clear();
                            Logger.Flush(msg);
                            removeFilepaths.Add(filepath);
                        }
                    }
                }

                int index = 0;
                foreach (Seiseki se in bunkatu)
                {
                    Util_Machine.Flush_Seiseki_1file(se, expectedFiles[index], syuturyoku);
                    index++;
                }

                // 紛らわしい名前のファイルを削除するぜ☆(^▽^)
                foreach (string filepath in removeFilepaths)
                {
                    File.Delete(filepath);
                    syuturyoku.AppendLine($"{filepath}を削除したぜ☆(^~^)");
                }

                syuturyoku.Append(".");
                {
                    var msg = syuturyoku.ToString();
                    syuturyoku.Clear();
                    Logger.Flush(msg);
                }

                // 分割したファイルをマージするぜ☆(^▽^)
                for (int i = 1;//[0]にマージしていくぜ☆(^▽^)
                     i < bunkatu.Length; i++)
                {
                    Option_Application.Seiseki.Merge(bunkatu[i]);
                }

                syuturyoku.AppendLine("☆");
                {
                    var msg = syuturyoku.ToString();
                    syuturyoku.Clear();
                    Logger.Flush(msg);
                }
                Option_Application.Seiseki.Edited = false;
            }
        }
Пример #9
0
        public static void Test(StringBuilder syuturyoku)
        {
            //*
            {
                float[] alphas = new float[] {
                    1 / (WINDOW / 5.0f),
                    1 / (WINDOW / 6.0f),
                    1 / (WINDOW / 7.0f),
                    1 / (WINDOW / 8.0f),
                    1 / (WINDOW / 9.0f),
                };
                float[] nazos = new float[] {//謎の数字
                    5.0f,
                    6.0f,
                    7.0f,
                    8.0f,
                    9.0f,
                };

                for (int iA = 0; iA < alphas.Length; iA++)
                {
                    float alpha = alphas[iA];
                    float nazo  = nazos[iA];
                    syuturyoku.AppendLine($"nazo = [{nazo}]    alpha = [{ alpha }]");
                    // nazo が 7 の時に合わせて x を入れてあるぜ☆(^~^)
                    syuturyoku.AppendLine($"sisu(-256.0000) → [{ string.Format("{0,12:F9}", Sisu(alpha, -256.0000f)) }] y=Sigmoid({ string.Format("{0,12:F9}", Sigmoid(alpha, -256.0000f)) })"); //[7]
                    syuturyoku.AppendLine($"sisu(-255.0000) → [{ string.Format("{0,12:F9}", Sisu(alpha, -255.0000f)) }] y=Sigmoid({ string.Format("{0,12:F9}", Sigmoid(alpha, -255.0000f)) })"); //
                    syuturyoku.AppendLine($"sisu(-219.4285) → [{ string.Format("{0,12:F9}", Sisu(alpha, -219.4285f)) }] y=Sigmoid({ string.Format("{0,12:F9}", Sigmoid(alpha, -219.4285f)) })"); //[5.999998]
                    syuturyoku.AppendLine($"sisu(-192.0000) → [{ string.Format("{0,12:F9}", Sisu(alpha, -192.0000f)) }] y=Sigmoid({ string.Format("{0,12:F9}", Sigmoid(alpha, -192.0000f)) })"); //[5.25]
                    syuturyoku.AppendLine($"sisu(-182.8571) → [{ string.Format("{0,12:F9}", Sisu(alpha, -182.8571f)) }] y=Sigmoid({ string.Format("{0,12:F9}", Sigmoid(alpha, -182.8571f)) })"); //[4.999999]
                    syuturyoku.AppendLine($"sisu(-146.2857) → [{ string.Format("{0,12:F9}", Sisu(alpha, -146.2857f)) }] y=Sigmoid({ string.Format("{0,12:F9}", Sigmoid(alpha, -146.2857f)) })"); //[4]
                    syuturyoku.AppendLine($"sisu(-128.0000) → [{ string.Format("{0,12:F9}", Sisu(alpha, -128.0000f)) }] y=Sigmoid({ string.Format("{0,12:F9}", Sigmoid(alpha, -128.0000f)) })"); //[3.5]
                    syuturyoku.AppendLine($"sisu(-109.7142) → [{ string.Format("{0,12:F9}", Sisu(alpha, -109.7142f)) }] y=Sigmoid({ string.Format("{0,12:F9}", Sigmoid(alpha, -109.7142f)) })"); //[2.999998]
                    syuturyoku.AppendLine($"sisu(- 73.1428) → [{ string.Format("{0,12:F9}", Sisu(alpha, -73.1428f)) }] y=Sigmoid({ string.Format("{0,12:F9}", Sigmoid(alpha, -73.1428f)) })");   //[1.999998]
                    syuturyoku.AppendLine($"sisu(- 36.5714) → [{ string.Format("{0,12:F9}", Sisu(alpha, -36.5714f)) }] y=Sigmoid({ string.Format("{0,12:F9}", Sigmoid(alpha, -36.5714f)) })");   //[0.9999992]
                    syuturyoku.AppendLine($"sisu(-  1.0000) → [{ string.Format("{0,12:F9}", Sisu(alpha, -1.0000f)) }] y=Sigmoid({ string.Format("{0,12:F9}", Sigmoid(alpha, -1.0000f)) })");     //[0.02734375]
                    syuturyoku.AppendLine($"sisu(   0.0000) → [{ string.Format("{0,12:F9}", Sisu(alpha, 0.0000f)) }] y=Sigmoid({ string.Format("{0,12:F9}", Sigmoid(alpha, 0.0000f)) })");       //[0]
                    syuturyoku.AppendLine($"sisu(   1.0000) → [{ string.Format("{0,12:F9}", Sisu(alpha, 1.0000f)) }] y=Sigmoid({ string.Format("{0,12:F9}", Sigmoid(alpha, 1.0000f)) })");       //[-0.02734375]
                    syuturyoku.AppendLine($"sisu(  36.5714) → [{ string.Format("{0,12:F9}", Sisu(alpha, 36.5714f)) }] y=Sigmoid({ string.Format("{0,12:F9}", Sigmoid(alpha, 36.5714f)) })");     //[-0.9999992]
                    syuturyoku.AppendLine($"sisu(  73.1428) → [{ string.Format("{0,12:F9}", Sisu(alpha, 73.1428f)) }] y=Sigmoid({ string.Format("{0,12:F9}", Sigmoid(alpha, 73.1428f)) })");     //[-1.999998]
                    syuturyoku.AppendLine($"sisu( 109.7142) → [{ string.Format("{0,12:F9}", Sisu(alpha, 109.7142f)) }] y=Sigmoid({ string.Format("{0,12:F9}", Sigmoid(alpha, 109.7142f)) })");   //[-2.999998]
                    syuturyoku.AppendLine($"sisu( 128.0000) → [{ string.Format("{0,12:F9}", Sisu(alpha, 128.0000f)) }] y=Sigmoid({ string.Format("{0,12:F9}", Sigmoid(alpha, 128.0000f)) })");   //[-3.5]
                    syuturyoku.AppendLine($"sisu( 146.2857) → [{ string.Format("{0,12:F9}", Sisu(alpha, 146.2857f)) }] y=Sigmoid({ string.Format("{0,12:F9}", Sigmoid(alpha, 146.2857f)) })");   //[-4]
                    syuturyoku.AppendLine($"sisu( 182.8571) → [{ string.Format("{0,12:F9}", Sisu(alpha, 182.8571f)) }] y=Sigmoid({ string.Format("{0,12:F9}", Sigmoid(alpha, 182.8571f)) })");   //[-4.999999]
                    syuturyoku.AppendLine($"sisu( 192.0000) → [{ string.Format("{0,12:F9}", Sisu(alpha, 192.0000f)) }] y=Sigmoid({ string.Format("{0,12:F9}", Sigmoid(alpha, 192.0000f)) })");   //[-5.25]
                    syuturyoku.AppendLine($"sisu( 219.4285) → [{ string.Format("{0,12:F9}", Sisu(alpha, 219.4285f)) }] y=Sigmoid({ string.Format("{0,12:F9}", Sigmoid(alpha, 219.4285f)) })");   //[-5.999998]
                    syuturyoku.AppendLine($"sisu( 255.0000) → [{ string.Format("{0,12:F9}", Sisu(alpha, 255.0000f)) }] y=Sigmoid({ string.Format("{0,12:F9}", Sigmoid(alpha, 255.0000f)) })");   //
                    syuturyoku.AppendLine($"sisu( 256.0000) → [{ string.Format("{0,12:F9}", Sisu(alpha, 256.0000f)) }] y=Sigmoid({ string.Format("{0,12:F9}", Sigmoid(alpha, 256.0000f)) })");   //[-7]
                    syuturyoku.AppendLine();
                }
            }
            // */

            /*
             * nazo = [5]    alpha = [0.01953125]
             * sisu(-256.0000) → [ 5.000000000] y=Sigmoid( 0.006692851)
             * sisu(-255.0000) → [ 4.980469000] y=Sigmoid( 0.006823955)
             * sisu(-219.4285) → [ 4.285713000] y=Sigmoid( 0.013576940)
             * sisu(-192.0000) → [ 3.750000000] y=Sigmoid( 0.022977370)
             * sisu(-182.8571) → [ 3.571428000] y=Sigmoid( 0.027346810)
             * sisu(-146.2857) → [ 2.857143000] y=Sigmoid( 0.054313280)
             * sisu(-128.0000) → [ 2.500000000] y=Sigmoid( 0.075858180)
             * sisu(-109.7142) → [ 2.142856000] y=Sigmoid( 0.105000700)
             * sisu(- 73.1428) → [ 1.428570000] y=Sigmoid( 0.193321600)
             * sisu(- 36.5714) → [ 0.714285100] y=Sigmoid( 0.328652700)
             * sisu(-  1.0000) → [ 0.019531250] y=Sigmoid( 0.495117400)
             * sisu(   0.0000) → [ 0.000000000] y=Sigmoid( 0.500000000)
             * sisu(   1.0000) → [-0.019531250] y=Sigmoid( 0.504882600)
             * sisu(  36.5714) → [-0.714285100] y=Sigmoid( 0.671347300)
             * sisu(  73.1428) → [-1.428570000] y=Sigmoid( 0.806678500)
             * sisu( 109.7142) → [-2.142856000] y=Sigmoid( 0.894999300)
             * sisu( 128.0000) → [-2.500000000] y=Sigmoid( 0.924141800)
             * sisu( 146.2857) → [-2.857143000] y=Sigmoid( 0.945686700)
             * sisu( 182.8571) → [-3.571428000] y=Sigmoid( 0.972653200)
             * sisu( 192.0000) → [-3.750000000] y=Sigmoid( 0.977022600)
             * sisu( 219.4285) → [-4.285713000] y=Sigmoid( 0.986423100)
             * sisu( 255.0000) → [-4.980469000] y=Sigmoid( 0.993176000)
             * sisu( 256.0000) → [-5.000000000] y=Sigmoid( 0.993307200)
             *
             * nazo = [6]    alpha = [0.0234375]
             * sisu(-256.0000) → [ 6.000000000] y=Sigmoid( 0.002472623)
             * sisu(-255.0000) → [ 5.976563000] y=Sigmoid( 0.002531111)
             * sisu(-219.4285) → [ 5.142856000] y=Sigmoid( 0.005807068)
             * sisu(-192.0000) → [ 4.500000000] y=Sigmoid( 0.010986940)
             * sisu(-182.8571) → [ 4.285713000] y=Sigmoid( 0.013576930)
             * sisu(-146.2857) → [ 3.428571000] y=Sigmoid( 0.031414380)
             * sisu(-128.0000) → [ 3.000000000] y=Sigmoid( 0.047425870)
             * sisu(-109.7142) → [ 2.571427000] y=Sigmoid( 0.071000150)
             * sisu(- 73.1428) → [ 1.714284000] y=Sigmoid( 0.152608800)
             * sisu(- 36.5714) → [ 0.857142200] y=Sigmoid( 0.297936800)
             * sisu(-  1.0000) → [ 0.023437500] y=Sigmoid( 0.494140900)
             * sisu(   0.0000) → [ 0.000000000] y=Sigmoid( 0.500000000)
             * sisu(   1.0000) → [-0.023437500] y=Sigmoid( 0.505859100)
             * sisu(  36.5714) → [-0.857142200] y=Sigmoid( 0.702063300)
             * sisu(  73.1428) → [-1.714284000] y=Sigmoid( 0.847391200)
             * sisu( 109.7142) → [-2.571427000] y=Sigmoid( 0.928999800)
             * sisu( 128.0000) → [-3.000000000] y=Sigmoid( 0.952574100)
             * sisu( 146.2857) → [-3.428571000] y=Sigmoid( 0.968585600)
             * sisu( 182.8571) → [-4.285713000] y=Sigmoid( 0.986423100)
             * sisu( 192.0000) → [-4.500000000] y=Sigmoid( 0.989013100)
             * sisu( 219.4285) → [-5.142856000] y=Sigmoid( 0.994193000)
             * sisu( 255.0000) → [-5.976563000] y=Sigmoid( 0.997468900)
             * sisu( 256.0000) → [-6.000000000] y=Sigmoid( 0.997527400)
             *
             * nazo = [7]    alpha = [0.02734375]
             * sisu(-256.0000) → [ 7.000000000] y=Sigmoid( 0.000911051)
             * sisu(-255.0000) → [ 6.972656000] y=Sigmoid( 0.000936283)
             * sisu(-219.4285) → [ 5.999998000] y=Sigmoid( 0.002472628)
             * sisu(-192.0000) → [ 5.250000000] y=Sigmoid( 0.005220126)
             * sisu(-182.8571) → [ 4.999999000] y=Sigmoid( 0.006692858)
             * sisu(-146.2857) → [ 4.000000000] y=Sigmoid( 0.017986210)
             * sisu(-128.0000) → [ 3.500000000] y=Sigmoid( 0.029312230)
             * sisu(-109.7142) → [ 2.999998000] y=Sigmoid( 0.047425980)
             * sisu(- 73.1428) → [ 1.999998000] y=Sigmoid( 0.119203100)
             * sisu(- 36.5714) → [ 0.999999200] y=Sigmoid( 0.268941600)
             * sisu(-  1.0000) → [ 0.027343750] y=Sigmoid( 0.493164500)
             * sisu(   0.0000) → [ 0.000000000] y=Sigmoid( 0.500000000)
             * sisu(   1.0000) → [-0.027343750] y=Sigmoid( 0.506835500)
             * sisu(  36.5714) → [-0.999999200] y=Sigmoid( 0.731058400)
             * sisu(  73.1428) → [-1.999998000] y=Sigmoid( 0.880796900)
             * sisu( 109.7142) → [-2.999998000] y=Sigmoid( 0.952574000)
             * sisu( 128.0000) → [-3.500000000] y=Sigmoid( 0.970687700)
             * sisu( 146.2857) → [-4.000000000] y=Sigmoid( 0.982013800)
             * sisu( 182.8571) → [-4.999999000] y=Sigmoid( 0.993307100)
             * sisu( 192.0000) → [-5.250000000] y=Sigmoid( 0.994779900)
             * sisu( 219.4285) → [-5.999998000] y=Sigmoid( 0.997527400)
             * sisu( 255.0000) → [-6.972656000] y=Sigmoid( 0.999063700)
             * sisu( 256.0000) → [-7.000000000] y=Sigmoid( 0.999088900)
             *
             * nazo = [8]    alpha = [0.03125]
             * sisu(-256.0000) → [ 8.000000000] y=Sigmoid( 0.000335350)
             * sisu(-255.0000) → [ 7.968750000] y=Sigmoid( 0.000345992)
             * sisu(-219.4285) → [ 6.857141000] y=Sigmoid( 0.001050812)
             * sisu(-192.0000) → [ 6.000000000] y=Sigmoid( 0.002472623)
             * sisu(-182.8571) → [ 5.714284000] y=Sigmoid( 0.003287666)
             * sisu(-146.2857) → [ 4.571428000] y=Sigmoid( 0.010237290)
             * sisu(-128.0000) → [ 4.000000000] y=Sigmoid( 0.017986210)
             * sisu(-109.7142) → [ 3.428569000] y=Sigmoid( 0.031414450)
             * sisu(- 73.1428) → [ 2.285712000] y=Sigmoid( 0.092313180)
             * sisu(- 36.5714) → [ 1.142856000] y=Sigmoid( 0.241796300)
             * sisu(-  1.0000) → [ 0.031250000] y=Sigmoid( 0.492188100)
             * sisu(   0.0000) → [ 0.000000000] y=Sigmoid( 0.500000000)
             * sisu(   1.0000) → [-0.031250000] y=Sigmoid( 0.507811800)
             * sisu(  36.5714) → [-1.142856000] y=Sigmoid( 0.758203700)
             * sisu(  73.1428) → [-2.285712000] y=Sigmoid( 0.907686800)
             * sisu( 109.7142) → [-3.428569000] y=Sigmoid( 0.968585600)
             * sisu( 128.0000) → [-4.000000000] y=Sigmoid( 0.982013800)
             * sisu( 146.2857) → [-4.571428000] y=Sigmoid( 0.989762700)
             * sisu( 182.8571) → [-5.714284000] y=Sigmoid( 0.996712300)
             * sisu( 192.0000) → [-6.000000000] y=Sigmoid( 0.997527400)
             * sisu( 219.4285) → [-6.857141000] y=Sigmoid( 0.998949200)
             * sisu( 255.0000) → [-7.968750000] y=Sigmoid( 0.999654000)
             * sisu( 256.0000) → [-8.000000000] y=Sigmoid( 0.999664700)
             *
             * nazo = [9]    alpha = [0.03515625]
             * sisu(-256.0000) → [ 9.000000000] y=Sigmoid( 0.000123395)
             * sisu(-255.0000) → [ 8.964844000] y=Sigmoid( 0.000127809)
             * sisu(-219.4285) → [ 7.714283000] y=Sigmoid( 0.000446206)
             * sisu(-192.0000) → [ 6.750000000] y=Sigmoid( 0.001169510)
             * sisu(-182.8571) → [ 6.428570000] y=Sigmoid( 0.001612155)
             * sisu(-146.2857) → [ 5.142857000] y=Sigmoid( 0.005807060)
             * sisu(-128.0000) → [ 4.500000000] y=Sigmoid( 0.010986940)
             * sisu(-109.7142) → [ 3.857140000] y=Sigmoid( 0.020691170)
             * sisu(- 73.1428) → [ 2.571427000] y=Sigmoid( 0.071000150)
             * sisu(- 36.5714) → [ 1.285713000] y=Sigmoid( 0.216579300)
             * sisu(-  1.0000) → [ 0.035156250] y=Sigmoid( 0.491211900)
             * sisu(   0.0000) → [ 0.000000000] y=Sigmoid( 0.500000000)
             * sisu(   1.0000) → [-0.035156250] y=Sigmoid( 0.508788200)
             * sisu(  36.5714) → [-1.285713000] y=Sigmoid( 0.783420700)
             * sisu(  73.1428) → [-2.571427000] y=Sigmoid( 0.928999800)
             * sisu( 109.7142) → [-3.857140000] y=Sigmoid( 0.979308800)
             * sisu( 128.0000) → [-4.500000000] y=Sigmoid( 0.989013100)
             * sisu( 146.2857) → [-5.142857000] y=Sigmoid( 0.994193000)
             * sisu( 182.8571) → [-6.428570000] y=Sigmoid( 0.998387900)
             * sisu( 192.0000) → [-6.750000000] y=Sigmoid( 0.998830500)
             * sisu( 219.4285) → [-7.714283000] y=Sigmoid( 0.999553800)
             * sisu( 255.0000) → [-8.964844000] y=Sigmoid( 0.999872200)
             * sisu( 256.0000) → [-9.000000000] y=Sigmoid( 0.999876600)
             */

            var msg = syuturyoku.ToString();

            syuturyoku.Clear();
            Logger.Flush(msg);
            Util_Machine.ReadKey();
        }
Пример #10
0
 public static void LoadNikoma(StringBuilder syuturyoku)
 {
     Util_Machine.Load_Nikoma(syuturyoku);
 }
Пример #11
0
 public static void LoadSeiseki(StringBuilder syuturyoku)
 {
     Util_Machine.Load_Seiseki(syuturyoku);
 }
Пример #12
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

            // 該当しないものは無視だぜ☆(^▽^)
        }
Пример #13
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();
        }