public List <string> GenerateAsteriskList(int height)
        {
            var asteriskList = new List <string>();

            for (int count = 0; count < height; count++)
            {
                var pattern = new PatternPyramid();
                asteriskList.Add(pattern.Print(count + 1));
            }
            return(asteriskList);
        }
Example #2
0
        public override string Print(int height)
        {
            var builder = new StringBuilder();

            for (int count = 0; count < height; count++)
            {
                var pattern = new PatternPyramid();
                builder.Append(pattern.Print(count + 1));
                builder.Append("\n");
            }

            return(builder.ToString());
        }