Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //1.3.8.4......................................................................................
- string comand = "Wait Comand";
- string name = "";
- string bgcolor = "";
- Console.WriteLine("введите команду: \nSetName \nDisplayName \nSetColor \nDisplayBoxWithName");
- while (comand != "Exit")
- {
- while (comand == "Wait Comand")
- {
- comand = Console.ReadLine();
- }
- while (comand == "SetName")
- {
- Console.WriteLine("как вас зовут?");
- name = Console.ReadLine();
- Console.WriteLine("ваше имя зарегистрировано как:" + name);
- comand = "Wait Comand";
- }
- while (comand == "DisplayName")
- {
- Console.WriteLine("сколько раз вывести имя?");
- int i = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine(name);
- comand = "Wait Comand";
- while (i-- > 1)
- {
- Console.WriteLine(name);
- }
- }
- while (comand == "SetColor")
- {
- Console.WriteLine("введите из списка желаемый цвет фона: \nGreen \nRed \nBlack");
- bgcolor = Console.ReadLine();
- if (bgcolor == "Green")
- {
- Console.BackgroundColor = ConsoleColor.Green;
- }
- if (bgcolor == "Red")
- {
- Console.BackgroundColor = ConsoleColor.Red;
- }
- if (bgcolor == "Black")
- {
- Console.BackgroundColor = ConsoleColor.Black;
- }
- Console.WriteLine("Отлично а теперь, введите из списка желаемый цвет символов:\nGreen \nRed \nBlack");
- bgcolor = Console.ReadLine();
- if (bgcolor == "Green")
- {
- Console.ForegroundColor = ConsoleColor.Green;
- }
- if (bgcolor == "Red")
- {
- Console.ForegroundColor = ConsoleColor.Red;
- }
- if (bgcolor == "Black")
- {
- Console.ForegroundColor = ConsoleColor.Black;
- }
- comand = "Wait comand";
- }
- while (comand == "DisplayBoxWithName")
- {
- string side = new string('#', name.Length + 4) + "\n";
- string space = new string('#', 1) + new string(' ', name.Length + 2) + new string('#', 1) + "\n";
- string middle = new string('#', 1) + ' ' + name + ' ' + new string('#', 1) + "\n";
- string result = side + space + middle + space + side;
- Console.WriteLine(result);
- comand = "Wait comand";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment