Example #1
0
        // Вывод игрового поля
        public static void MethodWhichPrintGameField(ClassGameOne game)
        {
            Console.CursorTop = 2;
            //Console.WriteLine("\t\t\t Y");
            //Console.WriteLine("\r\t\t   X");

            int[,] helperMassive = new int[(int)Math.Sqrt(game.returnfield().Length), (int)Math.Sqrt(game.returnfield().Length)];
            for (int i = 0; i < helperMassive.GetLength(0); i++)
            {
                Console.Write("\t\t\t");
                for (int j = 0; j < helperMassive.GetLength(1); j++)
                {
                    if (game[i, j] == 0)
                    {
                        Console.Write("|");
                        Console.ForegroundColor = ConsoleColor.Black;
                        Console.Write(game[i, j]);
                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.Write("|" + "\t");
                    }
                    else
                    {
                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.Write("|" + game[i, j] + "|" + "\t");
                    }
                }
                Console.WriteLine();
            }
        }