Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        public void Delete_Triangle(IsTriangle t)
        {
            if (Triangles.Count == 0)
            {
                Console.WriteLine("List is empty !");
                return;
            }

            Triangles.Remove(t);
        }
Ejemplo n.º 3
0
        static public void Draw(IsTriangle t)
        {
            int h = 8;
            int i, j, k, p;

            p = 1;
            for (i = 1; i <= h; i++)
            {
                for (j = (2 * h - 1) - p; j > 0; j--)
                {
                    Console.Write(" ");
                }
                for (k = 1; k <= p; k++)
                {
                    Console.Write("* ");
                }
                p += 2;
                Console.WriteLine();
            }
        }
Ejemplo n.º 4
0
 public void addTriangle(IsTriangle q)
 {
     Triangles.Add(q);
 }