1
0

Update things

This commit is contained in:
2021-12-01 19:32:38 +01:00
parent ccfcf5a259
commit 322f8eb45a
53 changed files with 156 additions and 239 deletions
@@ -2,7 +2,6 @@ package be.vandewalleh.aoc;
import be.vandewalleh.aoc.utils.factory.Days;
import be.vandewalleh.aoc.utils.input.Day;
import be.vandewalleh.aoc.utils.input.Input;
import be.vandewalleh.aoc.utils.input.Lines;
@Day(1)
@@ -16,8 +15,8 @@ public class Day01 {
private final int[] input;
public Day01(@Lines Input<int[]> input) {
this.input = input.getValue();
public Day01(@Lines int[] input) {
this.input = input;
}
private int fuel(int mass) {
@@ -4,7 +4,6 @@ import be.vandewalleh.aoc.intcode.IntCodeInterpreter;
import be.vandewalleh.aoc.utils.factory.Days;
import be.vandewalleh.aoc.utils.input.Csv;
import be.vandewalleh.aoc.utils.input.Day;
import be.vandewalleh.aoc.utils.input.Input;
@Day(2)
public class Day02 {
@@ -17,8 +16,8 @@ public class Day02 {
private final int[] input;
public Day02(@Csv Input<int[]> input) {
this.input = input.getValue();
public Day02(@Csv int[] input) {
this.input = input;
}
private long runInterpreterWith(int noun, int verb) {
@@ -4,7 +4,6 @@ import be.vandewalleh.aoc.geometry.Direction2D;
import be.vandewalleh.aoc.geometry.Point2D;
import be.vandewalleh.aoc.utils.factory.Days;
import be.vandewalleh.aoc.utils.input.Day;
import be.vandewalleh.aoc.utils.input.Input;
import be.vandewalleh.aoc.utils.input.Lines;
import java.util.ArrayList;
@@ -23,9 +22,9 @@ public class Day03 {
private final String[] wireA;
private final String[] wireB;
public Day03(@Lines Input<List<String>> input) {
this.wireA = input.getValue().get(0).split(",");
this.wireB = input.getValue().get(1).split(",");
public Day03(@Lines List<String> input) {
this.wireA = input.get(0).split(",");
this.wireB = input.get(1).split(",");
}
private List<Point2D> path(String[] wire) {
@@ -2,7 +2,6 @@ package be.vandewalleh.aoc;
import be.vandewalleh.aoc.utils.factory.Days;
import be.vandewalleh.aoc.utils.input.Day;
import be.vandewalleh.aoc.utils.input.Input;
import be.vandewalleh.aoc.utils.input.Text;
import java.util.Arrays;
@@ -21,8 +20,8 @@ public class Day04 {
private final int min;
private final int max;
public Day04(@Text Input<String> input) {
var spl = input.getValue().split("-", 2);
public Day04(@Text String input) {
var spl = input.split("-", 2);
min = Integer.parseInt(spl[0]);
max = Integer.parseInt(spl[1]);
}
@@ -4,7 +4,6 @@ import be.vandewalleh.aoc.intcode.IntCodeInterpreter;
import be.vandewalleh.aoc.utils.factory.Days;
import be.vandewalleh.aoc.utils.input.Csv;
import be.vandewalleh.aoc.utils.input.Day;
import be.vandewalleh.aoc.utils.input.Input;
@Day(5)
public class Day05 {
@@ -17,8 +16,8 @@ public class Day05 {
private final int[] input;
public Day05(@Csv Input<int[]> input) {
this.input = input.getValue();
public Day05(@Csv int[] input) {
this.input = input;
}
private Long part1() {
@@ -2,7 +2,6 @@ package be.vandewalleh.aoc;
import be.vandewalleh.aoc.utils.factory.Days;
import be.vandewalleh.aoc.utils.input.Day;
import be.vandewalleh.aoc.utils.input.Input;
import be.vandewalleh.aoc.utils.input.Lines;
import java.util.*;
@@ -18,8 +17,8 @@ public class Day06 {
private final List<String> input;
public Day06(@Lines Input<List<String>> input) {
this.input = input.getValue();
public Day06(@Lines List<String> input) {
this.input = input;
}
private final Map<String, String> reverseOrbits = new HashMap<>();
@@ -1,7 +1,5 @@
package be.vandewalleh.aoc.intcode;
import java.util.Optional;
public enum OpCode {
Add(1, 3),
Multiply(2, 3),