Day 1 + 2

This commit is contained in:
Marcel Fries
2019-12-02 13:52:49 +01:00
commit 3aa60c0700
6 changed files with 214 additions and 0 deletions

19
day02/main.nim Normal file
View File

@@ -0,0 +1,19 @@
import computer
proc solvePart1(): void =
var
cp = newComputer("input.txt")
input = Input(noun: 12, verb: 2)
cp.reset(input)
let result = cp.run
echo "Result for Part 1: ", result
proc solvePart2(): void =
var
target = 19690720
cp = newComputer("input.txt")
inputs = cp.findInputFor(target)
echo "result for Part 2: ", 100 * inputs.noun + inputs.verb
solvePart1()
solvePart2()