-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDay9.java
31 lines (23 loc) · 799 Bytes
/
Day9.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package aoc19;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import myutils19.IntCodeComputer;
import myutils19.StaticUtils;
public class Day9 {
private List<Long> initialProgram;
public Day9(File input) {
initialProgram = StaticUtils.commaSeperatedLongFileToList(input);
}
public long run() {
IntCodeComputer computer = new IntCodeComputer(new ArrayList<>(initialProgram));
// provide input value 1 for part 1, input value 2 for part 2
computer.setInputValues(2);
computer.run();
return computer.mostRecentOutputValue().get();
}
public static void main(String[] args) {
Day9 test = new Day9(new File("C:\\Users\\Timucin\\Desktop\\Advent of code 2019\\Day 9\\InputFile.txt"));
System.out.println(test.run());
}
}