Day 4 Part 1

This commit is contained in:
Marcel Fries
2019-12-04 13:49:33 +01:00
parent 43e317a598
commit c8d7b67888
8 changed files with 46 additions and 0 deletions

19
day-02/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()