Пример #1
0
        static void Main()
        {
            EqTriangle   b = new EqTriangle(34, "Triangle", "blue");
            IsTriangle   c = new IsTriangle(34, 45, "IsTriangle", "Red");
            RectTriangle d = new RectTriangle(3, 4, "Trinagle", "red");

            Painter.Draw(b);
            Painter.Draw(c);
            Painter.Draw(d);
        }
Пример #2
0
        public void Delete_Triangle(EqTriangle t)
        {
            if (Triangles.Count == 0)
            {
                Console.WriteLine("List is empty !");
                return;
            }

            Triangles.Remove(t);
        }
Пример #3
0
        static public void Draw(EqTriangle t)
        {
            int h = 8;
            int i, j, k;

            for (i = 1; i <= h; i++)
            {
                for (j = h - i; j > 0; j--)
                {
                    Console.Write(" ");
                }
                for (k = 1; k <= i; k++)
                {
                    Console.Write("* ");
                }
                Console.WriteLine();
            }
        }
Пример #4
0
 public void addTriangle(EqTriangle q)
 {
     Triangles.Add(q);
 }