File tree Expand file tree Collapse file tree 8 files changed +16
-20
lines changed
Expand file tree Collapse file tree 8 files changed +16
-20
lines changed Original file line number Diff line number Diff line change 33
44package day01
55
6- import common.day
6+ import common.aocreader.fetchAdventOfCodeInput
77import common.parsing.parseColumns
8- import common.readInput
98import common.collectionops.toFrequencyMap
109import kotlin.math.abs
1110
@@ -25,7 +24,7 @@ fun answer2(input: String): Int =
2524 }
2625
2726fun main () {
28- val input = readInput({}:: class .day() )
27+ val input = fetchAdventOfCodeInput( 2024 , 1 )
2928
3029 println (" --- Day 1: Historian Hysteria ---" )
3130
Original file line number Diff line number Diff line change 33
44package day02
55
6+ import common.aocreader.fetchAdventOfCodeInput
67import common.collectionops.allListDrops
7- import common.day
88import common.parsing.parseGrid
9- import common.readInput
109
1110private const val Lower = 1
1211private const val Upper = 3
@@ -30,7 +29,7 @@ fun answer2(input: String): Int =
3029 parseGrid(input, String ::toInt).count(::isReportAlmostSafe)
3130
3231fun main () {
33- val input = readInput({}:: class .day() )
32+ val input = fetchAdventOfCodeInput( 2024 , 2 )
3433
3534 println (" --- Day 2: Red-Nosed Reports ---" )
3635
Original file line number Diff line number Diff line change 33
44package day03
55
6- import common.day
7- import common.readInput
6+ import common.aocreader.fetchAdventOfCodeInput
87
98/* *
109 * We want to turn off processing for substrings of the form:
@@ -31,7 +30,7 @@ fun answer2(input: String): Int =
3130 answer1(preprocess(input))
3231
3332fun main () {
34- val input = readInput({}:: class .day() )
33+ val input = fetchAdventOfCodeInput( 2024 , 3 )
3534
3635 println (" --- Day 3: Mull It Over ---" )
3736
Original file line number Diff line number Diff line change 33
44package day04
55
6+ import common.aocreader.fetchAdventOfCodeInput
67import common.countSubstrings
7- import common.day
88import common.collectionops.*
9- import common.readInput
109
1110private const val XMAS = " XMAS"
1211
@@ -60,7 +59,7 @@ fun answer2(input: String): Int =
6059 countXXmases(input.lines())
6160
6261fun main () {
63- val input = readInput({}:: class .day() )
62+ val input = fetchAdventOfCodeInput( 2024 , 4 )
6463
6564 println (" --- Day 4: Ceres Search ---" )
6665
Original file line number Diff line number Diff line change 33
44package day05
55
6- import common.day
6+ import common.aocreader.fetchAdventOfCodeInput
77import common.collectionops.middle
8- import common.readInput
98
109private typealias OrderingRules = Map <Int , Set <Int >>
1110private typealias Updates = List <Int >
@@ -96,7 +95,7 @@ fun answer2(input: String): Int =
9695 }
9796
9897fun main () {
99- val input = readInput({}:: class .day()).trim( )
98+ val input = fetchAdventOfCodeInput( 2024 , 5 )
10099
101100 println (" --- Day 5: Print Queue ---" )
102101
Original file line number Diff line number Diff line change 66
77package day06
88
9+ import common.aocreader.fetchAdventOfCodeInput
910import common.intpos2d.*
10- import common.day
11- import common.readInput
1211
1312/* *
1413 * The direction that the guard is facing and moves in.
@@ -101,7 +100,7 @@ fun answer2(input: String): Int =
101100 }
102101
103102fun main () {
104- val input = readInput({}:: class .day()).trim( )
103+ val input = fetchAdventOfCodeInput( 2024 , 6 )
105104
106105 println (" --- Day 6: Guard Gallivant ---" )
107106
Original file line number Diff line number Diff line change 33
44package day07
55
6+ import common.aocreader.fetchAdventOfCodeInput
67import common.day
78import common.parsing.WhitespaceParser
89import common.readInput
@@ -58,7 +59,7 @@ fun answer2(input: String): BigInteger =
5859
5960
6061fun main () {
61- val input = readInput({}:: class .day()).trim( )
62+ val input = fetchAdventOfCodeInput( 2024 , 7 )
6263
6364 println (" --- Day 7: Bridge Repair ---" )
6465
Original file line number Diff line number Diff line change 33
44package day08
55
6+ import common.aocreader.fetchAdventOfCodeInput
67import common.day
78import common.intpos2d.*
89import common.readInput
@@ -83,7 +84,7 @@ fun answer2(input: String): Int =
8384
8485
8586fun main () {
86- val input = readInput({}:: class .day()).trim( )
87+ val input = fetchAdventOfCodeInput( 2024 , 8 )
8788
8889 println (" --- Day 8: Resonant Collinearity ---" )
8990
You can’t perform that action at this time.
0 commit comments