public void Should_count_route_permutations() { var _inputReader = new InputReaders(); var path = @"C:\Users\emollett\Documents\sites\AdventOfCode2020\AdventOfCode2020\Inputs\10_AdapterArray_Test.txt"; var adapters = _inputReader.readLongNumbers(path); var _adapterArray = new AdapterArray(adapters); Assert.Equal(19208, _adapterArray.countRoutes()); }
public void Should_count_route_permutations_small_example() { var adapters = new List <long> { 16, 10, 15, 5, 1, 11, 7, 19, 6, 12, 4 }; var _adapterArray = new AdapterArray(adapters); Assert.Equal(8, _adapterArray.countRoutes()); }
public void Should_count_adaptor_differences() { var _inputReader = new InputReaders(); var path = @"C:\Users\emollett\Documents\sites\AdventOfCode2020\AdventOfCode2020\Inputs\10_AdapterArray_Test.txt"; var adapters = _inputReader.readLongNumbers(path); var _adapterArray = new AdapterArray(adapters); Assert.Equal(220, _adapterArray.countAdapters()); }
public void Should_count_adapter_differences_small_example() { var adapters = new List <long> { 16, 10, 15, 5, 1, 11, 7, 19, 6, 12, 4 }; var _adapterArray = new AdapterArray(adapters); Assert.Equal(35, _adapterArray.countAdapters()); }
public void ExamplePartTwoRecurssion(string[] input, int expected) { // Arrange var adapter = new AdapterArray(input); // Act var result = adapter.CalculateArrangements(); // Assert Assert.AreEqual(expected, result); }
public void ExamplePartOne(string[] input, int expected) { // Arrange var adapter = new AdapterArray(input); // Act var result = adapter.CalculateJoltsDifference(); // Assert Assert.AreEqual(expected, result); }
public void PuzzlePartTwo() { // Arrange var input = File .ReadLines("tests/y2020/Day10.Input.txt") .Select(x => Convert.ToInt32(x)); // Act var actual = AdapterArray.CountUnique(input); // Assert Assert.Equal(2107417088L, actual); }
public void PuzzlePartOne() { // Arrange var input = File .ReadLines("tests/y2020/Day10.Input.txt") .Select(x => Convert.ToInt32(x)); // Act var actual = AdapterArray.CountJolt(input); // Assert Assert.Equal(1998, actual); }
public void PuzzleOne() { // Arrange var input = new int[] { 16, 10, 15, 5, 1, 11, 7, 19, 6, 12, 4 }; // Act var actual = AdapterArray.CountJolt(input); // Assert Assert.Equal(5 * 7, actual); }
public void PuzzleTwo() { // Arrange var input = new int[] { // 16,10,15,5,1,11,7,19,6,12,4 28, 33, 18, 42, 31, 14, 46, 20, 48, 47, 24, 23, 49, 45, 19, 38, 39, 11, 1, 32, 25, 35, 8, 17, 7, 9, 4, 2, 34, 10, 3 }; // ****-****--***-**--****-*--**** // 4 4 3 2 4 1 4 // 7 x 7 x 4 x 2 x 7 x 7 // Act var actual = AdapterArray.CountUnique(input); // Assert Assert.Equal(19208, actual); }
public void Setup() { var adapterStrings = File.ReadAllLines("Data/Data.txt"); _adapterArray = new AdapterArray(adapterStrings); }
// == == == == == Puzzle 2 == == == == == public static string Puzzle2(string input) { var aa = new AdapterArray(input); return(aa.FindPossibleAdapterArrangements().ToString()); }
// == == == == == Puzzle 1 == == == == == public static string Puzzle1(string input) { var aa = new AdapterArray(input); return(aa.ChainAllAdapters().ToString()); }