Example #1
0
        static void Main(string[] args)
        {
            SortedTriangleContainer triangles = UI.GetTriangles();

            triangles.OrderByDescending();
            UI.PrintTriangles(triangles);
            Console.ReadLine();
        }
Example #2
0
        public static SortedTriangleContainer GetTriangles()
        {
            string userAnswer = "y";
            SortedTriangleContainer triangles = new SortedTriangleContainer();

            while (userAnswer == "y" || userAnswer == "yes")
            {
                Triangle currentTriangle = GetNewTriangle();
                if (currentTriangle != null)
                {
                    triangles.Add(currentTriangle);
                }
                Console.WriteLine("Do you want to continue (y/yes)?");
                userAnswer = Console.ReadLine().ToLower();
            }

            return(triangles);
        }
Example #3
0
 public static void PrintTriangles(SortedTriangleContainer triangles)
 {
     Console.WriteLine(triangles.ToString());
 }