public int Route_calculation(string input) { var chartBuilder = new AstronomicalChartBuilder(); var chart = chartBuilder.Build(input); var routeFinder = new AstronomicalRouteFinder(chart); var route = routeFinder.CalculateRoute("YOU", "SAN"); return(route.Count() - 1); // Minus one because we're already at the first step, as it were }
static void Main(string[] args) { var chartBuilder = new AstronomicalChartBuilder(); var input = File.ReadAllText(args[0]); var chart = chartBuilder.Build(input); var exporter = new DotExporter(); exporter.Export(args[0] + ".exported.dot", chart); }
public int Complex_chart_from_DSL(string inputFile) { var chartBuilder = new AstronomicalChartBuilder(); var input = File.ReadAllText($".\\{inputFile}.txt"); var chart = chartBuilder.Build(input); var calculator = new ChecksumCalculator(); var checksum = calculator.GetChecksum(chart); return(checksum); }
public void Day6_Part2() { var chartBuilder = new AstronomicalChartBuilder(); var input = File.ReadAllText(@".\PuzzleInput.txt"); var chart = chartBuilder.Build(input); var routeFinder = new AstronomicalRouteFinder(chart); var route = routeFinder.CalculateRoute("YOU", "SAN"); Assert.AreEqual(346, route.Count() - 1); }
public void Day6_Part1() { var chartBuilder = new AstronomicalChartBuilder(); var input = File.ReadAllText(@".\PuzzleInput.txt"); var chart = chartBuilder.Build(input); var calculator = new ChecksumCalculator(); var checksum = calculator.GetChecksum(chart); Assert.AreEqual(154386, checksum); }