コード例 #1
0
ファイル: Program.cs プロジェクト: Dimaematveev/Game_Geek
        private static void Draw(PlayController playController)
        {
            //знаков '-'
            const int numStr = 82;
            //на ячейку
            const int numCell = 8;
            //на ряд с номерами
            const int numNum = 2;

            Console.Write($"|{"",numNum}|");
            for (int c = 1; c <= playController.Column; c++)
            {
                Console.Write($"{c,numCell}|");
            }
            Console.WriteLine();
            Console.WriteLine(new string('-', numStr));
            for (int r = 1; r <= playController.Row; r++)
            {
                Console.Write($"|{r,numNum}|");

                for (int c = 1; c <= playController.Column; c++)
                {
                    if ((r + c) % 2 == 1)
                    {
                        var temp = playController.CheckersCell(r, c);
                        Console.Write($"{temp,numCell}|");
                    }
                    else
                    {
                        Console.Write(new string('*', numCell) + "|");
                    }
                }
                Console.WriteLine();
                Console.WriteLine(new string('-', numStr));
            }
        }