Exemplo n.º 1
0
        public override void Puzzle1()
        {
            toboggan = new Toboggan(0, 0, 3, 1);
            int hits = toboggan.Travel(input);

            Console.WriteLine($"We have hit {hits} trees");
        }
Exemplo n.º 2
0
        public override void Puzzle2()
        {
            int             hits      = 1;
            List <Toboggan> toboggans = new List <Toboggan>()
            {
                new Toboggan(0, 0, 1, 1),
                new Toboggan(0, 0, 3, 1),
                new Toboggan(0, 0, 5, 1),
                new Toboggan(0, 0, 7, 1),
                new Toboggan(0, 0, 1, 2),
            };

            foreach (Toboggan toboggan in toboggans)
            {
                hits *= toboggan.Travel(input);
            }

            Console.WriteLine($"We have hit {hits} trees");
        }