static void Main(string[] args) { VerticalLine v1 = new VerticalLine(3, 4, 1, '*'); v1.Draw(); HorizontalLine h1 = new HorizontalLine(1, 10, 2, '*'); h1.Draw(); //VerticalLine v1 = new VerticalLine(3, 4, 1, '*'); //v1.Draw(); VerticalLine v2 = new VerticalLine(3, 4, 10, '*'); v2.Draw(); HorizontalLine h2 = new HorizontalLine(1, 10, 5, '*'); h2.Draw(); Console.ReadKey(); }
static void Main(string[] args) { bool i = true; while (i == true) { try { Console.WriteLine("Введите координаты"); Console.Write("x = "); int x = Convert.ToInt16(Console.ReadLine()); Console.Write("y = "); int y = Convert.ToInt16(Console.ReadLine()); if (x >= 0 & y >= 0) { i = false; } Console.Clear(); HorizontalLine h1 = new HorizontalLine(x, x + 20, y, '*'); h1.Draw(); HorizontalLine h2 = new HorizontalLine(x, x + 20, y + 4, '*'); h2.Draw(); VerticalLine v1 = new VerticalLine(y + 1, y + 4, x, '*'); v1.Draw(); VerticalLine v2 = new VerticalLine(y + 1, y + 4, x + 20, '*'); v2.Draw(); Console.ReadKey(); } catch (Exception ex) { Console.WriteLine(ex.Message); Console.WriteLine(" "); Console.WriteLine("Нажмите любую кнопку, чтобы начать ввод данных заново"); Console.ReadKey(); Console.Clear(); } } }