示例#1
0
        public void Parse(bool isSfen, string[] lines, StringBuilder syuturyoku)
        {
            this.Clear();
            Kyokumen        ky2 = new Kyokumen();
            int             caret;
            SeisekiKyokumen josekiKy = null;

            int gyoBango = 1;

            foreach (string commandline in lines)
            {
                caret = 0;
                if (caret == commandline.IndexOf("fen ", caret))// fen で始まれば局面データ☆(^▽^)
                {
                    // キャレットは進めずに続行だぜ☆(^▽^)
                    if (!ky2.ParsePositionvalue(isSfen, commandline, ref caret, false, false, out string moves, syuturyoku))
                    {
                        string msg = $"パースに失敗だぜ☆(^~^)! #寒鰤 定跡ファイル解析失敗 {gyoBango}]行目";
                        syuturyoku.AppendLine(msg);
                        Logger.Flush(syuturyoku.ToString());
                        syuturyoku.Clear();
                        throw new Exception(msg);
                    }

                    {
                        ky2.Tekiyo(false, syuturyoku); // とりあえず全部作り直し☆(^~^)ルールは変わらないものとするぜ☆(^~^)
                        //ky2.KyokumenHash = ky2.CreateKyokumenHash();//必要最低限、ハッシュだけ適用しておくぜ☆(^▽^)
                    }

                    josekiKy = this.Parse_AddKyLine(commandline, ky2.KyokumenHash.Value, ky2.CurrentOptionalPhase);
                }
                else if (commandline.Trim().Length < 1)
                {
                    // 空行は無視☆
                    // 半角空白とか、全角空白とか、タブとか 入れてるやつは考慮しないぜ☆(^~^)!
                }
                else
                {
                    // それ以外は手筋☆(^▽^)
                    if (null == josekiKy)
                    {
                        throw new Exception("定跡ファイル解析失敗 定跡局面の指定なし☆");
                    }

                    josekiKy.AddSasite(ky2, commandline, syuturyoku);
                }

                gyoBango++;
            }
        }
示例#2
0
        /// <summary>
        /// 千日手のテストだぜ☆(^▽^)
        /// </summary>
        public static void SennitiTe(IPlaying playing, bool isSfen, Kyokumen ky, StringBuilder syuturyoku)
        {
            // 溜まっているログがあれば、吐き出させておくぜ☆(^~^)
            var msg = syuturyoku.ToString();

            Logger.Flush(msg);
            syuturyoku.Clear();

            CommandMode   mode        = CommandMode.NigenYoConsoleKaihatu;
            StringBuilder sippaiZenbu = new StringBuilder();
            bool          seikou      = true;//成功☆

            // 準備
            int motonoJosekiPer = Option_Application.Optionlist.JosekiPer;// 定跡通り指すと千日手になることがあるので、切っておくぜ☆(/_\)

            Option_Application.Optionlist.JosekiPer = 0;
            double motonoNikomaHyokaKeisu = Option_Application.Optionlist.NikomaHyokaKeisu;// 2駒関係の評価値が付いているときは、テストケースの想定している評価値と異なり、結果が変わることがあるぜ☆(^~^)

            Option_Application.Optionlist.NikomaHyokaKeisu = 0.0d;
            long motonoSikoJikan       = Option_Application.Optionlist.SikoJikan;// PCが重かったりして、1秒の思考時間じゃ足りないこともある☆??(^▽^)
            int  motonoSikoJikanRandom = Option_Application.Optionlist.SikoJikanRandom;

            Option_Application.Optionlist.SikoJikan       = 5000;          // 5秒もあれば足りるだろ☆(^~^)
            Option_Application.Optionlist.SikoJikanRandom = 0;
            int motonoJohoJikan = Option_Application.Optionlist.JohoJikan; // 読み筋は全部出してしまおうぜ☆(^▽^)

            Option_Application.Optionlist.JohoJikan = 0;

            #region 千日手のテスト☆
            // 千日手を判定するテストだぜ☆ きりんを上下しようぜ☆wwww(^▽^)
            {
                #region (01) 対局者1が千日手を認識するかのテストだぜ☆
                //if(false)
                {
                    StringBuilder mojiretu1 = new StringBuilder();
                    mojiretu1.AppendLine("# (01) 対局者1が千日手を認識するかのテストだぜ☆");
                    int fail = 0;
                    ky.DoHirate(isSfen, syuturyoku);
                    int oldSaidaiFukasa = Option_Application.Optionlist.SaidaiFukasa;
                    Option_Application.Optionlist.SaidaiFukasa = 1; // ログが出過ぎないように1手読みにするぜ☆
                    int count;
                    playing.Do(isSfen, "do c4c3", ky, mode, mojiretu1); count = ky.Konoteme.GetSennititeCount(); if (Const_Game.SENNITITE_COUNT == count)
                    {
                        fail = 1; goto gt_EndUnittestSennitite1a;
                    }                                                                                                                                                                                  //1回目
                    playing.Do(isSfen, "do a1a2", ky, mode, mojiretu1); count = ky.Konoteme.GetSennititeCount(); if (Const_Game.SENNITITE_COUNT == count)
                    {
                        fail = 2; goto gt_EndUnittestSennitite1a;
                    }
                    playing.Do(isSfen, "do c3c4", ky, mode, mojiretu1); count = ky.Konoteme.GetSennititeCount(); if (Const_Game.SENNITITE_COUNT == count)
                    {
                        fail = 3; goto gt_EndUnittestSennitite1a;
                    }
                    playing.Do(isSfen, "do a2a1", ky, mode, mojiretu1); count = ky.Konoteme.GetSennititeCount(); if (Const_Game.SENNITITE_COUNT == count)
                    {
                        fail = 4; goto gt_EndUnittestSennitite1a;
                    }

                    playing.Do(isSfen, "do c4c3", ky, mode, mojiretu1); count = ky.Konoteme.GetSennititeCount(); if (Const_Game.SENNITITE_COUNT == count)
                    {
                        fail = 5; goto gt_EndUnittestSennitite1a;
                    }                                                                                                                                                                                  //2回目
                    playing.Do(isSfen, "do a1a2", ky, mode, mojiretu1); count = ky.Konoteme.GetSennititeCount(); if (Const_Game.SENNITITE_COUNT == count)
                    {
                        fail = 6; goto gt_EndUnittestSennitite1a;
                    }
                    playing.Do(isSfen, "do c3c4", ky, mode, mojiretu1); count = ky.Konoteme.GetSennititeCount(); if (Const_Game.SENNITITE_COUNT == count)
                    {
                        fail = 7; goto gt_EndUnittestSennitite1a;
                    }
                    playing.Do(isSfen, "do a2a1", ky, mode, mojiretu1); count = ky.Konoteme.GetSennititeCount(); if (Const_Game.SENNITITE_COUNT == count)
                    {
                        fail = 8; goto gt_EndUnittestSennitite1a;
                    }

                    playing.Do(isSfen, "do c4c3", ky, mode, mojiretu1); count = ky.Konoteme.GetSennititeCount(); if (Const_Game.SENNITITE_COUNT != count)
                    {
                        fail = 9; goto gt_EndUnittestSennitite1a;
                    }                                                                                                                                                                                  //3回目 千日手☆(^▽^)

gt_EndUnittestSennitite1a:
                    Option_Application.Optionlist.SaidaiFukasa = oldSaidaiFukasa;//設定を元に戻しておくぜ☆
                    if (0 != fail)
                    {
                        if (seikou)
                        {
                            sippaiZenbu.Append(mojiretu1.ToString());
                        }
                        seikou = false;
                        sippaiZenbu.AppendLine($"# 失敗(01): 対局者1に、千日手が見えなかったぜ☆(/_\) fail=[{fail}] count=[{count}]");
                        //goto gt_EndUnitTest;
                    }
                }
                #endregion
                #region (02) 対局者2が千日手を認識するかのテストだぜ☆
                //if (false)
                {
                    StringBuilder mojiretu1 = new StringBuilder();
                    mojiretu1.AppendLine("# (02) 対局者2が千日手を認識するかのテストだぜ☆");
                    int fail = 0;
                    ky.SetBanjo(isSfen,
                                " ラゾ" +//キは持ち駒に☆
                                " ヒ " +
                                " ひ " +
                                "ぞらき", false, syuturyoku
                                );
                    ky.MotiKomas.Clear().Set(MotiKoma.k, 1);//{ 0, 0, 0, 0, 1, 0 }
                    ky.Tekiyo(true, syuturyoku);
                    int oldSaidaiFukasa = Option_Application.Optionlist.SaidaiFukasa;
                    Option_Application.Optionlist.SaidaiFukasa = 1; // ログが出過ぎないように1手読みにするぜ☆
                    int count;
                    playing.Do(isSfen, "do c4c3", ky, mode, mojiretu1); count = ky.Konoteme.GetSennititeCount(); if (Const_Game.SENNITITE_COUNT == count)
                    {
                        fail = 1; goto gt_EndUnittestSennitite1b;
                    }                                                                                                                                                                                  // 同一局面から外れた手

                    playing.Do(isSfen, "do K*a2", ky, mode, mojiretu1); count = ky.Konoteme.GetSennititeCount(); if (Const_Game.SENNITITE_COUNT == count)
                    {
                        fail = 2; goto gt_EndUnittestSennitite1b;
                    }                                                                                                                                                                                  // 1回目(きりん打)
                    playing.Do(isSfen, "do c3c4", ky, mode, mojiretu1); count = ky.Konoteme.GetSennititeCount(); if (Const_Game.SENNITITE_COUNT == count)
                    {
                        fail = 3; goto gt_EndUnittestSennitite1b;
                    }
                    playing.Do(isSfen, "do a2a1", ky, mode, mojiretu1); count = ky.Konoteme.GetSennititeCount(); if (Const_Game.SENNITITE_COUNT == count)
                    {
                        fail = 4; goto gt_EndUnittestSennitite1b;
                    }
                    playing.Do(isSfen, "do c4c3", ky, mode, mojiretu1); count = ky.Konoteme.GetSennititeCount(); if (Const_Game.SENNITITE_COUNT == count)
                    {
                        fail = 5; goto gt_EndUnittestSennitite1b;
                    }

                    playing.Do(isSfen, "do a1a2", ky, mode, mojiretu1); count = ky.Konoteme.GetSennititeCount(); if (Const_Game.SENNITITE_COUNT == count)
                    {
                        fail = 6; goto gt_EndUnittestSennitite1b;
                    }                                                                                                                                                                                  // 2回目(きりん指し)
                    playing.Do(isSfen, "do c3c4", ky, mode, mojiretu1); count = ky.Konoteme.GetSennititeCount(); if (Const_Game.SENNITITE_COUNT == count)
                    {
                        fail = 7; goto gt_EndUnittestSennitite1b;
                    }
                    playing.Do(isSfen, "do a2a1", ky, mode, mojiretu1); count = ky.Konoteme.GetSennititeCount(); if (Const_Game.SENNITITE_COUNT == count)
                    {
                        fail = 8; goto gt_EndUnittestSennitite1b;
                    }
                    playing.Do(isSfen, "do c4c3", ky, mode, mojiretu1); count = ky.Konoteme.GetSennititeCount(); if (Const_Game.SENNITITE_COUNT == count)
                    {
                        fail = 9; goto gt_EndUnittestSennitite1b;
                    }

                    playing.Do(isSfen, "do a1a2", ky, mode, mojiretu1); count = ky.Konoteme.GetSennititeCount(); if (Const_Game.SENNITITE_COUNT != count)
                    {
                        fail = 10; goto gt_EndUnittestSennitite1b;
                    }                                                                                                                                                                                   //3回目 千日手☆(^▽^)

gt_EndUnittestSennitite1b:
                    Option_Application.Optionlist.SaidaiFukasa = oldSaidaiFukasa;//設定を元に戻しておくぜ☆
                    if (0 != fail)
                    {
                        if (seikou)
                        {
                            sippaiZenbu.Append(mojiretu1.ToString());
                        }
                        seikou = false;
                        sippaiZenbu.AppendLine($"# 失敗(02): 対局者2に、千日手が見えなかったぜ☆(/_\) fail=[{fail}] count=[{count}]");
                        //goto gt_EndUnitTest;
                    }
                }
                #endregion
                #region (03)対局者1が、勝っているときは 千日手を回避するかのテストだぜ☆
                //if (false)
                {
                    StringBuilder mojiretu1 = new StringBuilder();
                    mojiretu1.AppendLine("# (03)対局者1が、勝っているときは 千日手を回避するかのテストだぜ☆");
                    bool fail = false;
                    ky.SetBanjo(isSfen,
                                "キラ " + // ゾは対局者1の持ち駒に☆
                                "   " + // ヒは対局者1の持ち駒に☆
                                " ひ " +
                                "ぞらき", false, syuturyoku
                                );
                    ky.MotiKomas.Clear().Set(MotiKoma.Z, 1).Set(MotiKoma.H, 1);// = new int[] { 1, 0, 1, 0, 0, 0 };
                    ky.Tekiyo(true, syuturyoku);
                    int oldSaidaiFukasa = Option_Application.Optionlist.SaidaiFukasa;
                    Option_Application.Optionlist.SaidaiFukasa = 1; // ログが出過ぎないように1手読みにするぜ☆
                    mojiretu1.AppendLine("# 1回目");
                    playing.Do(isSfen, "do c4c3", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do a1a2", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do c3c4", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do a2a1", ky, mode, mojiretu1);

                    mojiretu1.AppendLine("# 2回目");
                    playing.Do(isSfen, "do c4c3", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do a1a2", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do c3c4", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do a2a1", ky, mode, mojiretu1);

                    mojiretu1.AppendLine("# 次に千日手を回避するかだぜ☆(^▽^)");
                    playing.Go(isSfen, mode, ky, mojiretu1);
                    int count = ky.Konoteme.GetSennititeCount();
                    if (Const_Game.SENNITITE_COUNT == count)
                    {
                        fail = true; goto gt_EndUnittestSennitite2a;
                    }

gt_EndUnittestSennitite2a:
                    Option_Application.Optionlist.SaidaiFukasa = oldSaidaiFukasa;//設定を元に戻しておくぜ☆
                    if (fail)
                    {
                        if (seikou)
                        {
                            sippaiZenbu.Append(mojiretu1.ToString());
                        }
                        seikou = false;
                        sippaiZenbu.AppendLine("# 失敗(03): 対局者1が、勝っているときに 千日手を回避しなかったぜ☆(/_\)");
                        //goto gt_EndUnitTest;
                    }
                }
                #endregion
                #region (04)対局者2が、勝っているときは 千日手を回避するかのテストだぜ☆
                //if (false)
                {
                    StringBuilder mojiretu1 = new StringBuilder();
                    mojiretu1.AppendLine("# (04)対局者2が、勝っているときは 千日手を回避するかのテストだぜ☆");
                    bool fail = false;
                    ky.SetBanjo(isSfen,
                                " ラゾ" +                                                            //キ は対局者2の持ち駒に☆
                                " ヒ " +
                                "   " +                                                            //ひ は対局者2の持ち駒に☆
                                " らき"                                                              //ぞ は対局者2の持ち駒に☆
                                , false, syuturyoku);
                    ky.MotiKomas.Clear().Set(MotiKoma.z, 1).Set(MotiKoma.k, 1).Set(MotiKoma.h, 1); // = new int[] { 0, 0, 0, 1, 1, 1 };
                    ky.Tekiyo(true, syuturyoku);
                    int oldSaidaiFukasa = Option_Application.Optionlist.SaidaiFukasa;
                    Option_Application.Optionlist.SaidaiFukasa = 1; // ログが出過ぎないように1手読みにするぜ☆

                    mojiretu1.AppendLine("# 同一局面から外れた手");
                    playing.Do(isSfen, "do c4c3", ky, mode, mojiretu1);

                    mojiretu1.AppendLine("# 1回目(きりん打)");
                    playing.Do(isSfen, "do K*a2", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do c3c4", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do a2a1", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do c4c3", ky, mode, mojiretu1);

                    mojiretu1.AppendLine("# 2回目(きりん指し)");
                    playing.Do(isSfen, "do a1a2", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do c3c4", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do a2a1", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do c4c3", ky, mode, mojiretu1);

                    mojiretu1.AppendLine("# 次に千日手を回避するか、指させるぜ☆(^▽^)ww");
                    playing.Go(isSfen, mode, ky, mojiretu1);
                    int count = ky.Konoteme.GetSennititeCount();
                    if (Const_Game.SENNITITE_COUNT == count)
                    {
                        fail = true; goto gt_EndUnittestSennitite2b;
                    }

gt_EndUnittestSennitite2b:
                    Option_Application.Optionlist.SaidaiFukasa = oldSaidaiFukasa;//設定を元に戻しておくぜ☆
                    if (fail)
                    {
                        if (seikou)
                        {
                            sippaiZenbu.Append(mojiretu1.ToString());
                        }
                        seikou = false;
                        sippaiZenbu.AppendLine("# 失敗(04): 対局者2が、勝っているときに 千日手を回避しなかったぜ☆(/_\)");
                        //goto gt_EndUnitTest;
                    }
                }
                #endregion
                #region (05)対局者1が、勝っているときは 千日手の権利を渡さないテストだぜ☆
                //if (false)
                {
                    StringBuilder mojiretu1 = new StringBuilder();
                    mojiretu1.AppendLine("# (05)対局者1が、勝っているときは 千日手の権利を渡さないテストだぜ☆");
                    bool fail = false;
                    ky.SetBanjo(isSfen,
                                "キラ " + // ゾは対局者1の持ち駒に☆
                                "   " + // ヒは対局者1の持ち駒に☆
                                " ひ " +
                                "ぞらき"
                                , false, syuturyoku);
                    ky.MotiKomas.Clear().Set(MotiKoma.Z, 1).Set(MotiKoma.H, 1);// = new int[] { 1, 0, 1, 0, 0, 0 };
                    ky.Tekiyo(true, syuturyoku);
                    int oldSaidaiFukasa = Option_Application.Optionlist.SaidaiFukasa;
                    Option_Application.Optionlist.SaidaiFukasa = 1;     // ログが出過ぎないように1手読みにするぜ☆
                    playing.Do(isSfen, "do c4c3", ky, mode, mojiretu1); //1回目
                    playing.Do(isSfen, "do a1a2", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do c3c4", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do a2a1", ky, mode, mojiretu1);

                    playing.Do(isSfen, "do c4c3", ky, mode, mojiretu1); //2回目
                    playing.Do(isSfen, "do a1a2", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do c3c4", ky, mode, mojiretu1);

                    // 次に千日手の権利を渡すのを回避するかだぜ☆(^▽^)
                    playing.Go(isSfen, mode, ky, mojiretu1);
                    int count = ky.Konoteme.GetSennititeCount();
                    if (Const_Game.SENNITITE_COUNT == count)
                    {
                        fail = true; goto gt_EndUnittestSennitite3a;
                    }

gt_EndUnittestSennitite3a:
                    Option_Application.Optionlist.SaidaiFukasa = oldSaidaiFukasa;//設定を元に戻しておくぜ☆
                    if (fail)
                    {
                        if (seikou)
                        {
                            sippaiZenbu.Append(mojiretu1.ToString());
                        }
                        seikou = false;
                        sippaiZenbu.AppendLine("# 失敗(05): 対局者1が、勝っているときに 千日手の権利を渡さないことをしなかったんだぜ☆(/_\)");
                        //goto gt_EndUnitTest;
                    }
                }
                #endregion
                #region (06)対局者2が、勝っているときは 千日手の権利を渡さないテストだぜ☆
                //if (false)
                {
                    StringBuilder mojiretu1 = new StringBuilder();
                    mojiretu1.AppendLine("# (06)対局者2が、勝っているときは 千日手の権利を渡さないテストだぜ☆");
                    bool fail = false;
                    ky.SetBanjo(isSfen,
                                " ラゾ" +                                                            // キ は対局者2の持ち駒に☆
                                " ヒ " +
                                "   " +                                                            // ひ は対局者2の持ち駒に☆
                                " らき"                                                              // ぞ は対局者2の持ち駒に☆
                                , false, syuturyoku);
                    ky.MotiKomas.Clear().Set(MotiKoma.z, 1).Set(MotiKoma.k, 1).Set(MotiKoma.h, 1); // = new int[] { 0, 0, 0, 1, 1, 1 };
                    ky.Tekiyo(true, syuturyoku);
                    int oldSaidaiFukasa = Option_Application.Optionlist.SaidaiFukasa;
                    Option_Application.Optionlist.SaidaiFukasa = 1;     // ログが出過ぎないように1手読みにするぜ☆
                    playing.Do(isSfen, "do c4c3", ky, mode, mojiretu1); // 同一局面から外れた手

                    playing.Do(isSfen, "do K*a2", ky, mode, mojiretu1); // 1回目(きりん打)
                    playing.Do(isSfen, "do c3c4", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do a2a1", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do c4c3", ky, mode, mojiretu1);

                    playing.Do(isSfen, "do a1a2", ky, mode, mojiretu1); // 2回目(きりん指し)
                    playing.Do(isSfen, "do c3c4", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do a2a1", ky, mode, mojiretu1);

                    // 次に千日手の権利を渡すのを回避するかだぜ☆(^▽^)
                    playing.Go(isSfen, mode, ky, mojiretu1);
                    int count = ky.Konoteme.GetSennititeCount();
                    if (Const_Game.SENNITITE_COUNT == count)
                    {
                        fail = true; goto gt_EndUnittestSennitite3b;
                    }

gt_EndUnittestSennitite3b:
                    Option_Application.Optionlist.SaidaiFukasa = oldSaidaiFukasa;//設定を元に戻しておくぜ☆
                    if (fail)
                    {
                        if (seikou)
                        {
                            sippaiZenbu.Append(mojiretu1.ToString());
                        }
                        seikou = false;
                        sippaiZenbu.AppendLine("# 失敗(06): 対局者2が、勝っているときに 千日手の権利を渡さないことをしなかったんだぜ☆(/_\)");
                        //goto gt_EndUnitTest;
                    }
                }
                #endregion
                #region (07)対局者1が、負けているときは 千日手を受け入れるテストだぜ☆
                //if (false)
                {
                    StringBuilder mojiretu1 = new StringBuilder();
                    mojiretu1.AppendLine("# (07)対局者1が、負けているときは 千日手を受け入れるテストだぜ☆");
                    bool fail = false;
                    ky.SetBanjo(isSfen,
                                "キラゾ" +
                                " ヒ " +
                                "   " +                                         // ひ は対局者2の持ち駒に☆
                                " らき"                                           // ぞ は対局者2の持ち駒に☆
                                , false, syuturyoku);
                    ky.MotiKomas.Clear().Set(MotiKoma.z, 1).Set(MotiKoma.h, 1); // = new int[] { 0, 0, 0, 1, 0, 1 };
                    ky.Tekiyo(true, syuturyoku);
                    int oldSaidaiFukasa = Option_Application.Optionlist.SaidaiFukasa;
                    Option_Application.Optionlist.SaidaiFukasa = 1;     // ログが出過ぎないように1手読みにするぜ☆

                    playing.Do(isSfen, "do c4c3", ky, mode, mojiretu1); //1回目
                    playing.Do(isSfen, "do a1a2", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do c3c4", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do a2a1", ky, mode, mojiretu1);

                    playing.Do(isSfen, "do c4c3", ky, mode, mojiretu1); //2回目
                    playing.Do(isSfen, "do a1a2", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do c3c4", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do a2a1", ky, mode, mojiretu1);

                    // 次に千日手を受け入れるかだぜ☆(^▽^)
                    playing.Go(isSfen, mode, ky, mojiretu1);
                    Option_Application.Optionlist.SaidaiFukasa = oldSaidaiFukasa;//設定を元に戻しておくぜ☆

                    int count = ky.Konoteme.GetSennititeCount();
                    if (Const_Game.SENNITITE_COUNT != count)
                    {
                        fail = true; goto gt_EndUnittestSennitite4a;
                    }

gt_EndUnittestSennitite4a:
                    if (fail)
                    {
                        if (seikou)
                        {
                            sippaiZenbu.Append(mojiretu1.ToString());
                        }
                        seikou = false;
                        sippaiZenbu.AppendLine("# 失敗(07): 対局者1が、負けているときに 千日手を受け入れなかったんだぜ☆(/_\)");
                        //goto gt_EndUnitTest;
                    }
                }
                #endregion
                #region (08)対局者2が、負けているときは 千日手を受け入れるテストだぜ☆
                //if (false)
                {
                    StringBuilder mojiretu1 = new StringBuilder();
                    mojiretu1.AppendLine("# (08)対局者2が、負けているときは 千日手を受け入れるテストだぜ☆");
                    bool fail = false;
                    ky.SetBanjo(isSfen,
                                " ラ " + // キ は対局者2の持ち駒に☆ ゾ は対局者1の持ち駒に☆
                                "   " + // ヒ は対局者1の持ち駒に☆
                                " ひ " +
                                "ぞらき"
                                , false, syuturyoku);
                    ky.MotiKomas.Clear().Set(MotiKoma.Z, 1).Set(MotiKoma.H, 1).Set(MotiKoma.k, 1);// = new int[] { 1, 0, 1, 0, 1, 0 };
                    ky.Tekiyo(true, syuturyoku);
                    int oldSaidaiFukasa = Option_Application.Optionlist.SaidaiFukasa;
                    Option_Application.Optionlist.SaidaiFukasa = 1; // ログが出過ぎないように1手読みにするぜ☆

                    mojiretu1.AppendLine("# 同一局面から外れた手");
                    playing.Do(isSfen, "do c4c3", ky, mode, mojiretu1);

                    mojiretu1.AppendLine("# 1回目(きりん打)");
                    playing.Do(isSfen, "do K*a2", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do c3c4", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do a2a1", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do c4c3", ky, mode, mojiretu1);

                    mojiretu1.AppendLine("# 2回目(きりん指し)");
                    playing.Do(isSfen, "do a1a2", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do c3c4", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do a2a1", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do c4c3", ky, mode, mojiretu1);

                    mojiretu1.AppendLine("# 次に きりん を上げて、千日手を受け入れるかだぜ☆(^▽^)");
                    playing.MoveCmd(isSfen, "move seisei", ky, mojiretu1);
                    playing.Go(isSfen, mode, ky, mojiretu1);
                    Option_Application.Optionlist.SaidaiFukasa = oldSaidaiFukasa;//設定を元に戻しておくぜ☆

                    int count = ky.Konoteme.GetSennititeCount();
                    if (Const_Game.SENNITITE_COUNT != count)
                    {
                        fail = true; goto gt_EndUnittestSennitite4b;
                    }

gt_EndUnittestSennitite4b:
                    if (fail)
                    {
                        if (seikou)
                        {
                            sippaiZenbu.Append(mojiretu1.ToString());
                        }
                        seikou = false;
                        sippaiZenbu.AppendLine("# 失敗(08): 対局者2が、負けているときに 千日手を受け入れなかったんだぜ☆(/_\)");
                        //goto gt_EndUnitTest;
                    }
                }
                #endregion
                #region (09)対局者2が、負けているときは 千日手の権利を相手に渡すテストだぜ☆
                //if (false)
                {
                    StringBuilder mojiretu1 = new StringBuilder();
                    mojiretu1.AppendLine("# (09)対局者2が、負けているときは 千日手の権利を相手に渡すテストだぜ☆");
                    bool fail = false;
                    ky.SetBanjo(isSfen,
                                "キラ " + // ゾは対局者1の持ち駒に☆
                                "   " + // ヒは対局者1の持ち駒に☆
                                " ひ " +
                                "ぞらき"
                                , false, syuturyoku);
                    ky.MotiKomas.Clear().Set(MotiKoma.Z, 1).Set(MotiKoma.H, 1);// = new int[] { 1, 0, 1, 0, 0, 0 };
                    ky.Tekiyo(true, syuturyoku);
                    int oldSaidaiFukasa = Option_Application.Optionlist.SaidaiFukasa;
                    Option_Application.Optionlist.SaidaiFukasa = 2; // 相手に千日手の手番を回したいので、2手読み以上にする必要があるぜ☆(^▽^)

                    mojiretu1.AppendLine("# 1回目");
                    playing.Do(isSfen, "do c4c3", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do a1a2", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do c3c4", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do a2a1", ky, mode, mojiretu1);

                    mojiretu1.AppendLine("# 2回目");
                    playing.Do(isSfen, "do c4c3", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do a1a2", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do c3c4", ky, mode, mojiretu1);

                    mojiretu1.AppendLine("# ↓次の手に注目だぜ☆ 対局者2は きりん を引いて、千日手の権利を相手に渡すかだぜ☆(^▽^)");
                    playing.Go(isSfen, mode, ky, mojiretu1);                      // do a2a1 とやることを期待☆
                    Option_Application.Optionlist.SaidaiFukasa = oldSaidaiFukasa; //設定を元に戻しておくぜ☆

                    Kyokumen ky2 = new Kyokumen();
                    ky2.SetBanjo(isSfen,
                                 "キラ " +
                                 "   " +
                                 " ひ " +
                                 "ぞらき", true, syuturyoku);
                    int[] motikomas1 = { 1, 0, 1, 0, 0, 0, };
                    if (!ky.Equals(ky2.Shogiban, motikomas1))
                    {
                        fail = true;
                    }

                    if (fail)
                    {
                        if (seikou)
                        {
                            sippaiZenbu.Append(mojiretu1.ToString());
                        }
                        seikou = false;
                        sippaiZenbu.AppendLine("# 失敗(09): 対局者2が、負けているときに 千日手の権利を相手に渡さなかったんだぜ☆(/_\)");
                        //goto gt_EndUnitTest;
                    }
                }
                #endregion
                #region (10)対局者1が、負けているときは 千日手の権利を相手に渡すテストだぜ☆
                //if (false)
                {
                    StringBuilder mojiretu1 = new StringBuilder();
                    mojiretu1.AppendLine("# (10)対局者1が、負けているときは 千日手の権利を相手に渡すテストだぜ☆");
                    bool fail = false;
                    ky.SetBanjo(isSfen,
                                " ラゾ" +                                                            // キ は対局者2の持ち駒に☆
                                " ヒ " +
                                "   " +                                                            // ひ は対局者2の持ち駒に☆
                                " らき"                                                              // ぞ は対局者2の持ち駒に☆
                                , false, syuturyoku);
                    ky.MotiKomas.Clear().Set(MotiKoma.z, 1).Set(MotiKoma.k, 1).Set(MotiKoma.h, 1); // = new int[] { 0, 0, 0, 1, 1, 1 };
                    ky.Tekiyo(true, syuturyoku);
                    int oldSaidaiFukasa = Option_Application.Optionlist.SaidaiFukasa;
                    Option_Application.Optionlist.SaidaiFukasa = 2; // 相手に千日手の手番を回したいので、2手読み以上にする必要があるぜ☆(^▽^)

                    mojiretu1.AppendLine("# 同一局面から外れた手");
                    playing.Do(isSfen, "do c4c3", ky, mode, mojiretu1);

                    mojiretu1.AppendLine("# 1回目(きりん打)");
                    playing.Do(isSfen, "do K*a2", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do c3c4", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do a2a1", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do c4c3", ky, mode, mojiretu1);

                    mojiretu1.AppendLine("# 2回目(きりん指し)");
                    playing.Do(isSfen, "do a1a2", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do c3c4", ky, mode, mojiretu1);
                    playing.Do(isSfen, "do a2a1", ky, mode, mojiretu1);

                    mojiretu1.AppendLine("# ↓次の手に注目だぜ☆ 対局者1は きりん を上げて、千日手の権利を相手に渡すかだぜ☆(^▽^)");
                    playing.Go(isSfen, mode, ky, mojiretu1);                      // do c4c3 とやることを期待☆
                    Option_Application.Optionlist.SaidaiFukasa = oldSaidaiFukasa; //設定を元に戻しておくぜ☆

                    Kyokumen ky2 = new Kyokumen();
                    ky2.SetBanjo(isSfen,
                                 "キラゾ" +
                                 " ヒ " +
                                 "  き" +
                                 " ら ", true, syuturyoku);
                    int[] motikomas1 = { 0, 0, 0, 1, 0, 1, };
                    if (!ky.Equals(ky2.Shogiban, motikomas1))
                    {
                        fail = true;
                    }

                    if (fail)
                    {
                        if (seikou)
                        {
                            sippaiZenbu.Append(mojiretu1.ToString());
                        }
                        seikou = false;
                        sippaiZenbu.AppendLine("# 失敗(10): 対局者1が、負けているときに、千日手の権利を相手に渡さなかったんだぜ☆(/_\)");
                        //goto gt_EndUnitTest;
                    }
                }
                #endregion
            }
            #endregion
            //gt_EndUnitTest:
            //;

            // 元に戻すぜ☆(^▽^)
            Option_Application.Optionlist.JosekiPer        = motonoJosekiPer;
            Option_Application.Optionlist.NikomaHyokaKeisu = motonoNikomaHyokaKeisu;
            Option_Application.Optionlist.SikoJikan        = motonoSikoJikan;
            Option_Application.Optionlist.SikoJikanRandom  = motonoSikoJikanRandom;
            Option_Application.Optionlist.JohoJikan        = motonoJohoJikan;

            if (seikou)
            {
                syuturyoku.AppendLine("ユニットテストの結果は、オール・オッケーだぜ☆(^▽^)");
            }
            else
            {
                syuturyoku.Append(sippaiZenbu.ToString()); // 失敗した過程のログ☆
            }

            var msg2 = syuturyoku.ToString();
            Logger.Flush(msg2);
            syuturyoku.Clear();
        }
示例#3
0
        /// <summary>
        /// 詰将棋を用意するぜ☆
        /// </summary>
        public static void TumeShogi(bool isSfen, int bango, Kyokumen ky, StringBuilder syuturyoku)
        {
            // FIXME: 終わったら元に戻したいが☆(^~^)
            Option_Application.Optionlist.PNChar[(int)Phase.Black] = MoveCharacter.TansakuNomi;
            Option_Application.Optionlist.PNChar[(int)Phase.White] = MoveCharacter.TansakuNomi;
            //Option_Application.Optionlist.BetaCutPer = 0; // ベータ・カットは使わないぜ☆(^▽^)wwww
            //Option_Application.Optionlist.TranspositionTableTukau = false; // トランスポジション・テーブルは使わないぜ☆(^▽^)wwww
            Option_Application.Optionlist.JosekiPer        = 0;     // 定跡は使わないぜ☆(^▽^)
            Option_Application.Optionlist.NikomaHyokaKeisu = 0;     // 二駒関係の評価値も使わないぜ☆(^▽^)
            Option_Application.Optionlist.SikoJikan        = 60000; // とりあえず 60 秒ぐらい☆
            Option_Application.Optionlist.SikoJikanRandom  = 0;
            Option_Application.Optionlist.JohoJikan        = 0;     // 情報全部出すぜ☆

            // 詰め手数 + 1 にしないと、詰んでるか判断できないぜ☆(^▽^)
            //int motonoSaidaiFukasa = Option_Application.Optionlist.SaidaiFukasa;

            switch (bango)
            {
                #region 1手詰め
            case 0:
            {
                syuturyoku.AppendLine("# 1手詰め");
                Option_Application.Optionlist.SaidaiFukasa = 1 + 1;
                ky.SetBanjo(isSfen,
                            " ラ " +
                            "き ひ" +
                            " ら " +
                            "   ", false, syuturyoku);
                ky.MotiKomas.Clear().Set(MotiKoma.H, 1);        // = new int[] { 0, 0, 1, 0, 0, 0 };
                ky.Tekiyo(true, syuturyoku);
                Util_Information.Setumei_Lines_Kyokumen(ky, syuturyoku);
                syuturyoku.AppendLine();
            }
            break;

                #endregion
                #region 1手詰め
            case 1:
            {
                syuturyoku.AppendLine("# 1手詰め");
                Option_Application.Optionlist.SaidaiFukasa = 3 + 1;
                ky.SetBanjo(isSfen,
                            "  ラ" +
                            "き  " +
                            " ら " +
                            "   ", false, syuturyoku);
                ky.MotiKomas.Clear();        // = new int[] { 0, 0, 0, 0, 0, 0 };
                ky.Tekiyo(true, syuturyoku);
                Util_Information.Setumei_Lines_Kyokumen(ky, syuturyoku);
                syuturyoku.AppendLine();
            }
            break;

                #endregion
                #region 3手詰め
            case 2:
            {
                syuturyoku.AppendLine("# 3手詰め");
                Option_Application.Optionlist.SaidaiFukasa = 3 + 1;
                ky.SetBanjo(isSfen,
                            " ゾラ" +
                            "   " +
                            "ぞ  " +
                            "ら  ", false, syuturyoku);
                ky.MotiKomas.Clear().Set(MotiKoma.Z, 1).Set(MotiKoma.H, 1);        // = new int[] { 1, 0, 1, 0, 0, 0 };
                ky.Tekiyo(true, syuturyoku);
                Util_Information.Setumei_Lines_Kyokumen(ky, syuturyoku);
                syuturyoku.AppendLine();
            }
            break;

                #endregion
                #region 1手詰め
            case 3:
            {
                syuturyoku.AppendLine("# 1手詰め");
                Option_Application.Optionlist.SaidaiFukasa = 1 + 1;
                ky.SetBanjo(isSfen,
                            " ゾ " +
                            " ぞラ" +
                            "ぞ  " +
                            "ら  ", false, syuturyoku);
                ky.MotiKomas.Clear().Set(MotiKoma.H, 1);        // = new int[] { 0, 0, 1, 0, 0, 0 };
                ky.Tekiyo(true, syuturyoku);
                Util_Information.Setumei_Lines_Kyokumen(ky, syuturyoku);
                syuturyoku.AppendLine();
            }
            break;

                #endregion
                #region 1手詰め
            default:
            {
                syuturyoku.AppendLine("# 1手詰め");
                Option_Application.Optionlist.SaidaiFukasa = 1 + 1;
                ky.SetBanjo(isSfen,
                            " ラ " +
                            "き き" +
                            " にら" +
                            "ぞひぞ", false, syuturyoku);
                ky.MotiKomas.Clear();        // = new int[] { 0, 0, 0, 0, 0, 0 };
                ky.Tekiyo(true, syuturyoku);
                Util_Information.Setumei_Lines_Kyokumen(ky, syuturyoku);
                syuturyoku.AppendLine();
            }
            break;
                #endregion
            }
        }
示例#4
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

            // 該当しないものは無視だぜ☆(^▽^)
        }