qzya256

Untitled

May 10th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.36 KB | None | 0 0
  1.             //1.3.8.4......................................................................................
  2.             string comand = "Wait Comand";
  3.             string name = "";
  4.             string bgcolor = "";
  5.            
  6.             Console.WriteLine("введите команду: \nSetName \nDisplayName \nSetColor \nDisplayBoxWithName");
  7.             while (comand != "Exit")
  8.             {
  9.                 while (comand == "Wait Comand")
  10.                 {
  11.                     comand = Console.ReadLine();
  12.                 }
  13.                 while (comand == "SetName")
  14.                 {
  15.                     Console.WriteLine("как вас зовут?");
  16.                     name = Console.ReadLine();
  17.                     Console.WriteLine("ваше имя зарегистрировано как:" + name);
  18.                     comand = "Wait Comand";
  19.                 }
  20.                 while (comand == "DisplayName")
  21.                 {
  22.                     Console.WriteLine("сколько раз вывести имя?");
  23.                     int i = Convert.ToInt32(Console.ReadLine());
  24.                     Console.WriteLine(name);
  25.                     comand = "Wait Comand";
  26.                     while (i-- > 1)
  27.                     {
  28.                         Console.WriteLine(name);
  29.                     }
  30.                 }
  31.                 while (comand == "SetColor")
  32.                 {
  33.                     Console.WriteLine("введите из списка желаемый цвет фона: \nGreen \nRed \nBlack");
  34.                     bgcolor = Console.ReadLine();
  35.                     if (bgcolor == "Green")
  36.                     {
  37.                         Console.BackgroundColor = ConsoleColor.Green;
  38.                     }
  39.                     if (bgcolor == "Red")
  40.                     {
  41.                         Console.BackgroundColor = ConsoleColor.Red;
  42.                     }
  43.                     if (bgcolor == "Black")
  44.                     {
  45.                         Console.BackgroundColor = ConsoleColor.Black;
  46.                     }
  47.                     Console.WriteLine("Отлично а теперь, введите из списка желаемый цвет символов:\nGreen \nRed \nBlack");
  48.                     bgcolor = Console.ReadLine();
  49.                     if (bgcolor == "Green")
  50.                     {
  51.                         Console.ForegroundColor = ConsoleColor.Green;
  52.                     }
  53.                     if (bgcolor == "Red")
  54.                     {
  55.                         Console.ForegroundColor = ConsoleColor.Red;
  56.                     }
  57.                     if (bgcolor == "Black")
  58.                     {
  59.                         Console.ForegroundColor = ConsoleColor.Black;
  60.                     }
  61.                     comand = "Wait comand";
  62.                 }
  63.                 while (comand == "DisplayBoxWithName")
  64.                 {
  65.                     string side = new string('#', name.Length + 4) + "\n";
  66.                     string space = new string('#', 1) + new string(' ', name.Length + 2) + new string('#', 1) + "\n";
  67.                     string middle = new string('#', 1) + ' ' + name + ' ' + new string('#', 1) + "\n";
  68.  
  69.                     string result = side + space + middle + space + side;
  70.  
  71.                     Console.WriteLine(result);
  72.                     comand = "Wait comand";
  73.                 }
  74.             }
Advertisement
Add Comment
Please, Sign In to add comment