Ejemplo n.º 1
0
        public override object SolvePartOne()
        {
            var rlist = new RoomList();

            var lines = FileLineParser.GetAllLines(@"Day04\Day04Input.txt");

            foreach (var line in lines)
            {
                rlist.AddRoom(line);
            }

            return(rlist.SumValidIds());
        }
Ejemplo n.º 2
0
        public override object SolvePartTwo()
        {
            var specs = new TriangleSpecs();

            var lines = FileLineParser.GetAllLines("Day03\\Day03Input.txt").ToList();

            for (int i = 0; i < lines.Count; i += 3)
            {
                specs.AddVerticalTriangles(new [] { lines[i], lines[i + 1], lines[i + 2] });
            }

            return(specs.ValidCount);
        }
Ejemplo n.º 3
0
        public override object SolvePartOne()
        {
            var specs = new TriangleSpecs();

            var lines = FileLineParser.GetAllLines("Day03\\Day03Input.txt");

            foreach (var line in lines)
            {
                specs.AddTriangle(line);
            }

            return(specs.ValidCount);
        }
Ejemplo n.º 4
0
        public override object SolvePartTwo()
        {
            var rlist = new RoomList();

            var lines = FileLineParser.GetAllLines(@"Day04\Day04Input.txt");

            foreach (var line in lines)
            {
                rlist.AddRoom(line);
            }

            var northpoleobjectstorage = rlist.SearchRoomByName("northpole");

            return($"{northpoleobjectstorage.ID} ({northpoleobjectstorage.DecipherName()})");
        }
Ejemplo n.º 5
0
 private IEnumerable <string> GetLines(string path)
 {
     return(FileLineParser.GetAllLines(path));
 }
Ejemplo n.º 6
0
        public override object SolvePartTwo()
        {
            var lines = FileLineParser.GetAllLines(@"Day02\Day02Input.txt");

            return(GetBathroomDesignCode(lines));
        }
Ejemplo n.º 7
0
 public void SetUp()
 {
     lines = FileLineParser.GetAllLines($@"Day08{Path.DirectorySeparatorChar}Day08TestInput.txt");
 }
Ejemplo n.º 8
0
 private IEnumerable <string> ReadFile()
 {
     return(FileLineParser.GetAllLines(@"Day08\Day08Input.txt"));
 }