Пример #1
0
        public static void Starting_View_Board(ref int[,] array)
        {
            Console.Clear();
            Console.WriteLine("   " + "0" + " " + "1" + " " + "2" + " " + "3" + " " + "4" + " " + "5" + " " + "6" + " " + "7");
            Console.WriteLine();
            for (int x = 0; x < 8; x++)
            {
                Console.WriteLine(x + "  " + array[x, 0] + " " + array[x, 1] + " " + array[x, 2] + " " + array[x, 3] + " " + array[x, 4] + " " + array[x, 5] + " " + array[x, 6] + " " + array[x, 7]);
            }

            Player_VS_Player.Player_Ones_Turn(ref array);
        }
Пример #2
0
        static void Menu()
        {
            Console.ForegroundColor = ConsoleColor.Cyan;
            Console.Clear();
            Console.WriteLine("Welcome to Draughts");
            Console.WriteLine("");
            Console.WriteLine("Please select one of the following options by inputting its number.");
            Console.WriteLine("1 - Player VS Player");
            Console.WriteLine("2 - Player VS Computer");
            Console.WriteLine("3 - Computer VS Computer");
            Console.WriteLine("4 - Exit Game");
            Console.WriteLine("");
            Console.WriteLine("Please Enter your choice");
            Console.ForegroundColor = ConsoleColor.White;

            try
            {
                int  selection    = Int32.Parse(Console.ReadLine());
                bool valid_number = false;

                while (valid_number != true)
                {
                    if ((selection >= 1) && (selection <= 4))
                    {
                        valid_number = true;

                        if (selection == 1)
                        {
                            Player_VS_Player.Players_Names(ref selection);
                            break;
                        }

                        else if (selection == 2)
                        {
                            Player_VS_Player.Players_Names(ref selection);
                            break;
                        }

                        else if (selection == 3)
                        {
                            break;
                        }

                        else if (selection == 4)
                        {
                            Environment.Exit(0);
                            break;
                        }
                    }
                    else
                    {
                        Console.WriteLine("");
                        Console.WriteLine("Please enter a number between 1 and 4");
                        selection    = Int32.Parse(Console.ReadLine());
                        valid_number = false;
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("Enter numbers only", e);
                Console.WriteLine("Press Enter to continue ...");
                Console.ReadLine();
                Menu();
            }
        }