-
Notifications
You must be signed in to change notification settings - Fork 0
/
AdventOfCode2022.java
97 lines (72 loc) · 5.2 KB
/
AdventOfCode2022.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
public class AdventOfCode2022{
public static List<String> readInput(String filepath){
List<String> lines = new ArrayList<String>();
try{
lines = Files.readAllLines(Path.of(filepath));
}catch(java.io.IOException e){
System.err.println("IOException: " + e.getMessage());
}
return lines;
}
public static void main(String[] args){
/*
System.out.println("Day 01 Part 01: " + Day01.getPart01(readInput("./input_day01.txt")));
System.out.println("Day 01 Part 02: " + Day01.getPart02(readInput("./input_day01.txt")));
System.out.println("Day 02 Part 01: " + Day02.getPart01(readInput("./input_day02.txt")));
System.out.println("Day 02 Part 02: " + Day02.getPart02(readInput("./input_day02.txt")));
System.out.println("Day 03 Part 01: " + Day03.getPart01(readInput("./input_day03.txt")));
System.out.println("Day 03 Part 02: " + Day03.getPart02(readInput("./input_day03.txt")));
System.out.println("Day 04 Part 01: " + Day04.getPart01(readInput("./input_day04.txt")));
System.out.println("Day 04 Part 02: " + Day04.getPart02(readInput("./input_day04.txt")));
System.out.println("Day 05 Part 01: " + Day05.getPart01(readInput("./input_day05.txt")));
System.out.println("Day 05 Part 02: " + Day05.getPart02(readInput("./input_day05.txt")));
System.out.println("Day 06 Part 01: " + Day06.getPart01(readInput("./input_day06.txt")));
System.out.println("Day 06 Part 02: " + Day06.getPart02(readInput("./input_day06.txt")));
System.out.println("Day 07 Part 01: " + Day07.getPart01(readInput("./input_day07.txt")));
System.out.println("Day 07 Part 02: " + Day07.getPart02(readInput("./input_day07.txt")));
System.out.println("Day 08 Part 01: " + Day08.getPart01(readInput("./input_day08.txt")));
System.out.println("Day 08 Part 02: " + Day08.getPart02(readInput("./input_day08.txt")));
System.out.println("Day 09 Part 01: " + Day09.getPart01(readInput("./input_day09.txt")));
System.out.println("Day 09 Part 02: " + Day09.getPart02(readInput("./input_day09.txt")));
System.out.println("Day 10 Part 02: " + Day10.getPart01(readInput("./input_day10.txt")));
System.out.println("Day 10 Part 01: " + Day10.getPart02(readInput("./input_day10.txt")));
System.out.println("Day 11 Part 01: " + Day11.getPart01(readInput("./input_day11.txt")));
System.out.println("Day 11 Part 02: " + Day11.getPart02(readInput("./input_day11.txt")));
System.out.println("Day 12 Part 01: " + Day12.getPart01(readInput("./input_day12.txt")));
System.out.println("Day 12 Part 02: " + Day12.getPart02(readInput("./input_day12.txt")));
System.out.println("Day 13 Part 01: " + Day13.getPart01(readInput("./input_day13.txt")));
System.out.println("Day 13 Part 02: " + Day13.getPart02(readInput("./input_day13.txt")));
System.out.println("Day 14 Part 01: " + Day14.getPart01(readInput("./input_day14.txt")));
System.out.println("Day 14 Part 02: " + Day14.getPart02(readInput("./input_day14.txt")));
System.out.println("Day 15 Part 01: " + Day15.getPart01(readInput("./input_day15.txt"),2000000));
System.out.println("Day 15 Part 02: " + Day15.getPart02(readInput("./input_day15.txt"),4000000));
*/
//System.out.println("Day 16 Part 01: " + Day16.getPart01(readInput("./input_day16_short.txt")));
//System.out.println("Day 16 Part 01: " + Day16.getPart01(readInput("./input_day16.txt")));
//System.out.println("Day 16 Part 02: " + Day16.getPart02(readInput("./input_day16_short.txt")));
//System.out.println("Day 16 Part 02: " + Day16.getPart02(readInput("./input_day16.txt")));
//System.out.println("Day 17 Part 01: " + Day17.getPart01(readInput("./input_day17.txt")));
//System.out.println("Day 17 Part 02: " + Day17.getPart02(readInput("./input_day17_short.txt")));
/*
System.out.println("Day 18 Part 01: " + Day18.getPart01(readInput("./input_day18.txt")));
System.out.println("Day 18 Part 02: " + Day18.getPart02(readInput("./input_day18.txt")));
System.out.println("Day 19 Part 01: " + Day19.getPart01(readInput("./input_day19.txt")));
System.out.println("Day 19 Part 02: " + Day19.getPart02(readInput("./input_day19.txt")));
System.out.println("Day 20 Part 01: " + Day20.getPart01(readInput("./input_day20.txt")));
System.out.println("Day 20 Part 02: " + Day20.getPart02(readInput("./input_day20.txt")));
System.out.println("Day 21 Part 01: " + Day21.getPart01(readInput("./input_day21.txt")));
System.out.println("Day 21 Part 02: " + Day21.getPart02(readInput("./input_day21.txt")));
System.out.println("Day 22 Part 01: " + Day22.getPart01(readInput("./input_day22.txt")));
System.out.println("Day 22 Part 02: " + Day22.getPart02(readInput("./input_day22.txt")));
*/
//System.out.println("Day 23 Part 01: " + Day23.getPart01(readInput("./input_day23.txt")));
//long start = System.currentTimeMillis();
//System.out.println("Day 23 Part 02: " + Day23.getPart02(readInput("./input_day23.txt")));
//System.err.println("time: " + (System.currentTimeMillis() - start) + " ms");
System.out.println("Day 24 Part 01: " + Day24.getPart01(readInput("./input_day24_short.txt")));
}
}