コード例 #1
0
        static void Main(string[] args)
        {
            Pyramid ps = new Pyramid();

            Console.WriteLine("Please Enter Count");
            int inputCount = int.Parse(Console.ReadLine());

            ps.DisplayPyramid(inputCount);
            Console.WriteLine("-----------------------------------");
            Telephone telephone = new Telephone();

            telephone.answer();
            Telephone.HangUp();

            Console.WriteLine("--------------------------------------------");
            CustomAttribute att = new CustomAttribute();

            Console.WriteLine("Please Enter String1");
            string str1 = Console.ReadLine();

            Console.WriteLine("Please Enter String2");
            string str2 = Console.ReadLine();

            att.setDetails(str1, str2);
            Console.WriteLine("Combine String : " + att.CombineString());
            Console.ReadKey();
        }
コード例 #2
0
 public PyramidProvider(Pyramid pyramid)
 {
     Base0 = pyramid.Base0;
     Base1 = pyramid.Base1;
     Base2 = pyramid.Base2;
     Base3 = pyramid.Base3;
     Top   = pyramid.Top;
 }
コード例 #3
0
        public static void Main(string[] args)
        {
            var p = new Pyramid(new[]
                                { new Point(0, 0, 0), new Point(0, 1, 0), new Point(1, 1, 0), new Point(1, 0, 0), new Point(1, 1, 1), });

            new PyramidProvider(p).SaveToFile("test.json");
            var d = PyramidProvider.LoadFromFile("test.json");

            Console.WriteLine(d.ToString());
        }
コード例 #4
0
        private List <List <Pyramid> > BuildPyramidsWithValues(List <string[]> valuesInLines)
        {
            var pyramidsWithValues = new List <List <Pyramid> >();

            foreach (var line in valuesInLines)
            {
                var pyramids = new List <Pyramid>();
                foreach (var value in line)
                {
                    var p = new Pyramid(Int32.Parse(value));
                    pyramids.Add(p);
                }
                pyramidsWithValues.Add(pyramids);
            }

            return(pyramidsWithValues);
        }