diff --git a/TTTConsole/Program.cs b/TTTConsole/Program.cs index 090f18d..20130c9 100644 --- a/TTTConsole/Program.cs +++ b/TTTConsole/Program.cs @@ -32,6 +32,7 @@ static string[] PLAYER_STR = new string[] { "", "先手", "後手" }; static string[] PLAYER_MARK = new string[] { " ", "○", "×" }; static string[] names; + static bool showNumber = false; /// /// プログラム開始点 @@ -68,6 +69,10 @@ if (thinkers[pl] < 1 || thinkers[pl] > names.Length) return; } + // 数字表示の選択 + Console.Write("○×の順番を表示しますか? 1:しない 2:する "); + showNumber = int.Parse(Console.ReadLine()) == 2 ? true : false; + // 対戦開始 ttt.Init(); do { @@ -127,10 +132,15 @@ var pIdx = ttt.Board[pos] > 0 ? PLAYER.First : ttt.Board[pos] < 0 ? PLAYER.Second : PLAYER.None; Console.Write(PLAYER_MARK[(int)pIdx]); + if (showNumber) Console.Write(ttt.Board[pos] == 0 ? " " : + string.Format("{0,2}", Math.Abs(ttt.Board[pos]))); if (col < ttt.BOARD_COLS - 1) Console.Write(" | "); } Console.WriteLine(""); - if (row < ttt.BOARD_ROWS - 1) Console.WriteLine(" ---+----+---"); + if (row < ttt.BOARD_ROWS - 1) { + if (showNumber) Console.WriteLine(" -----+------+-----"); + else Console.WriteLine(" ---+----+---"); + } } }