public void Day13_Example_01() { var input = @"939 7,13,x,x,59,x,31,19"; Assert.AreEqual(295, ShuttleSearch.GetEarliestCalculatedTimestamp(input.Split(Environment.NewLine))); }
public void PuzzlePartTwo() { var actual = ShuttleSearch.WolframAlpha( "23,x,x,x,x,x,x,x,x,x,x,x,x,41,x,x,x,x,x,x,x,x,x,829,x,x,x,x,x,x,x,x,x,x,x,x,13,17,x,x,x,x,x,x,x,x,x,x,x,x,x,x,29,x,677,x,x,x,x,x,37,x,x,x,x,x,x,x,x,x,x,x,x,19" ); Assert.Equal("(t+0) mod 23 = 0,(t+13) mod 41 = 0,(t+23) mod 829 = 0,(t+36) mod 13 = 0,(t+37) mod 17 = 0,(t+52) mod 29 = 0,(t+54) mod 677 = 0,(t+60) mod 37 = 0,(t+73) mod 19 = 0", actual); // -> "t = 2384517360007913 n + 600689120448303, n element Z" }
public void PuzzlePartOne() { // Act var actual = ShuttleSearch.EarliestBusMultiplyWaitingTime( 1002632, "23,x,x,x,x,x,x,x,x,x,x,x,x,41,x,x,x,x,x,x,x,x,x,829,x,x,x,x,x,x,x,x,x,x,x,x,13,17,x,x,x,x,x,x,x,x,x,x,x,x,x,x,29,x,677,x,x,x,x,x,37,x,x,x,x,x,x,x,x,x,x,x,x,19"); // Assert Assert.Equal(3385, actual); }
public void PuzzleOne() { // Arrange // Act var actual = ShuttleSearch.EarliestBusMultiplyWaitingTime(939, "7,13,x,x,59,x,31,19"); // Assert Assert.Equal(295, actual); }
static void Main(string[] args) { var shuttleSearch = new ShuttleSearch(File.ReadAllLines("../input.txt")); //Part One Console.WriteLine(shuttleSearch.GetEarliestTimeWithOneBus()); //Part Two Console.WriteLine(shuttleSearch.GetFirstConsecutiveTimeAllBusGo()); }
public void Day13_Full_Test01() { var data = TestUtil.GetFileContentsAsString("Day13.txt").Split(Environment.NewLine); Assert.AreEqual(3385, ShuttleSearch.GetEarliestCalculatedTimestamp(data)); }
public void Day13_Full_Test02() { var data = TestUtil.GetFileContentsAsString("Day13.txt").Split(Environment.NewLine); Assert.AreEqual(600689120448303, ShuttleSearch.GetLastPart(data[1])); }
public void Day13_Example_02() { var input = @"7,13,x,x,59,x,31,19"; Assert.AreEqual(1068781, ShuttleSearch.GetLastPart(input)); }
public void PartOneTest() { var subject = new ShuttleSearch(GetExampleInput()); Assert.Equal(295, subject.GetEarliestTimeWithOneBus()); }
public void PartTwoTest5() { var subject = new ShuttleSearch(GetExamplePartTwo5()); Assert.Equal(1202161486L, subject.GetFirstConsecutiveTimeAllBusGo()); }
public void PartTwoTest3() { var subject = new ShuttleSearch(GetExamplePartTwo3()); Assert.Equal(779210, subject.GetFirstConsecutiveTimeAllBusGo()); }
public void PartTwoTest() { var subject = new ShuttleSearch(GetExampleInput()); Assert.Equal(1068781, subject.GetFirstConsecutiveTimeAllBusGo()); }