static void Main(string[] args) { string fileName = "C:\\Source\\AdventOfCode\\Day20\\input.txt"; var file = new FileImportAdapter(); string[] input = file.ReadFileToArray(fileName); var rangeCompare = new RangeCompare(input, uint.MaxValue); rangeCompare.CalculateNonBlocked(); Console.Write("Lowest : " + rangeCompare.First); Console.Write(" IP Count : " + rangeCompare.Count); Console.ReadKey(); }
//Test should be advent //Input should be owlaxqvq public static void Part2() { int sectorCount = 0; var fileIO = new FileImportAdapter(); string[] invertedStrings = fileIO.ReadFileToArray("../../input.txt"); var strings = Utilities.Transpose(invertedStrings.ToList()); foreach (var str in strings) { var freq = new Frequency(str); freq.Build(); Console.Write(freq.BottomItem()); } }
static void Main(string[] args) { string fileName = "C:\\Source\\AdventOfCode\\Day12\\input.txt"; var file = new FileImportAdapter(); string[] instructions = file.ReadFileToArray(fileName); IInstruction[] instructionList = (new InstructionFactory()).CreateForList(instructions); Computer computer = new Computer(instructionList) { ['c'] = 1 }; // FOR PART 2 computer.ExecuteAll(); //Assert.AreEqual(317993, computer['a']); Console.Write(computer['a']); Console.ReadKey(); }
static void Main() { var fi = new FileImportAdapter(); var mazeArray = fi.ReadFileToArray("input.txt"); if (mazeArray.Length == 0) { return; } var maze = new Maze('#', '.', mazeArray); var links = maze.getAllLinks(); var path = new ShortestPathGenerator(); path.AddLinks(links); path.ReturnHome = true; path.SetStart(maze.Start); int shortest = path.ShortestPath(); Console.Write(shortest); Console.ReadKey(); }
internal FileImporter(IParser <string, T> parser, FileImportAdapter fileImportAdapter) { _parser = parser; _fileImportAdapter = fileImportAdapter; }