feat: add day 17 part 2 puzzle solution...but really only works on small input

This commit is contained in:
Stevan Freeborn
2024-12-19 01:29:08 -06:00
parent a2bad7524c
commit e799a64b35
2 changed files with 39 additions and 11 deletions
@@ -2,13 +2,22 @@
public class ComputerTests
{
private readonly string _exampleInput = $"Register A: 729{Environment.NewLine}Register B: 0{Environment.NewLine}Register C: 0{Environment.NewLine}{Environment.NewLine}Program: 0,1,5,4,3,0";
private readonly string _runProgramExampleInput = $"Register A: 729{Environment.NewLine}Register B: 0{Environment.NewLine}Register C: 0{Environment.NewLine}{Environment.NewLine}Program: 0,1,5,4,3,0";
private readonly string _findCopyExampleInput = $"Register A: 2024{Environment.NewLine}Register B: 0{Environment.NewLine}Register C: 0{Environment.NewLine}{Environment.NewLine}Program: 0,3,5,4,3,0";
[Test]
public async Task RunProgram_WhenCalledWithExampleInput_ItShouldReturnExpectedValue()
{
var result = Computer.From(_exampleInput).RunProgram();
var result = Computer.From(_runProgramExampleInput).RunProgram();
await Assert.That(result).IsEqualTo("4,6,3,5,6,3,5,2,1,0");
}
[Test]
public async Task FindCopy_WhenCalledWithExampleInput_ItShouldReturnExpectedValue()
{
var result = Computer.From(_findCopyExampleInput).FindCopy();
await Assert.That(result).IsEqualTo(117440);
}
}