Esempio n. 1
0
        public string GetAnswerB(bool animate = false)
        {
            var botFactory = new BotFactory(210, 200);

            botFactory.AddInstructions(File.ReadAllLines("Day10_input.txt").OrderBy(l => l));

            return("" + botFactory.OutputBins.Take(3)
                   .Select(o => o.Value).Aggregate(1, (x, y) => x * y));
        }
Esempio n. 2
0
        public string GetAnswerA(bool animate = false)
        {
            var botFactory = new BotFactory(210, 200);

            botFactory.AddInstructions(File.ReadAllLines("Day10_input.txt").OrderBy(l => l));

            return("" + botFactory.Bots
                   .First(b => b.ComparedValues.Contains(new Tuple <int, int>(17, 61))).BotId);
        }