From 3c9af95ec4a52ec1966b73e39745f102bbbf1d17 Mon Sep 17 00:00:00 2001 From: xuu Date: Sat, 26 Oct 2024 11:38:38 -0600 Subject: [PATCH] chore: setup folders for aoc 2024 --- {day01 => aoc2023/day01}/example1.txt | 0 {day01 => aoc2023/day01}/example2.txt | 0 {day01 => aoc2023/day01}/input.txt | 0 {day01 => aoc2023/day01}/main.go | 0 {day01 => aoc2023/day01}/main_test.go | 0 {day02 => aoc2023/day02}/example.txt | 0 {day02 => aoc2023/day02}/input.txt | 0 {day02 => aoc2023/day02}/main.go | 0 {day02 => aoc2023/day02}/main_test.go | 0 {day03 => aoc2023/day03}/example.txt | 0 {day03 => aoc2023/day03}/input.txt | 0 {day03 => aoc2023/day03}/main.go | 0 {day03 => aoc2023/day03}/main_test.go | 0 {day04 => aoc2023/day04}/example.txt | 0 {day04 => aoc2023/day04}/input.txt | 0 {day04 => aoc2023/day04}/main.go | 0 {day04 => aoc2023/day04}/main_test.go | 0 {day05 => aoc2023/day05}/example.txt | 0 {day05 => aoc2023/day05}/input.txt | 0 {day05 => aoc2023/day05}/main.go | 0 {day05 => aoc2023/day05}/main_test.go | 0 {day07 => aoc2023/day07}/example.txt | 0 {day07 => aoc2023/day07}/input.txt | 0 {day07 => aoc2023/day07}/input2.txt | 0 {day07 => aoc2023/day07}/main.go | 0 {day07 => aoc2023/day07}/main_test.go | 0 {day08 => aoc2023/day08}/example1.txt | 0 {day08 => aoc2023/day08}/example2.txt | 0 {day08 => aoc2023/day08}/example3.txt | 0 {day08 => aoc2023/day08}/input.txt | 0 {day08 => aoc2023/day08}/main.go | 0 {day08 => aoc2023/day08}/main_test.go | 0 {day09 => aoc2023/day09}/example.txt | 0 {day09 => aoc2023/day09}/input.txt | 0 {day09 => aoc2023/day09}/main.go | 0 {day09 => aoc2023/day09}/main_test.go | 0 {day10 => aoc2023/day10}/example1.txt | 0 {day10 => aoc2023/day10}/example2.txt | 0 {day10 => aoc2023/day10}/example3.txt | 0 {day10 => aoc2023/day10}/example4.txt | 0 {day10 => aoc2023/day10}/example5.txt | 0 {day10 => aoc2023/day10}/input.txt | 0 {day10 => aoc2023/day10}/main.go | 0 {day10 => aoc2023/day10}/main_test.go | 0 {day11 => aoc2023/day11}/example.txt | 0 {day11 => aoc2023/day11}/input.txt | 0 {day11 => aoc2023/day11}/main.go | 0 {day11 => aoc2023/day11}/main_test.go | 0 {day12 => aoc2023/day12}/example.txt | 0 {day12 => aoc2023/day12}/input.txt | 0 {day12 => aoc2023/day12}/main.go | 0 {day12 => aoc2023/day12}/main_test.go | 0 {day13 => aoc2023/day13}/example.txt | 0 {day13 => aoc2023/day13}/example00.txt | 0 {day13 => aoc2023/day13}/input.txt | 0 {day13 => aoc2023/day13}/input07.txt | 0 {day13 => aoc2023/day13}/main.go | 0 {day13 => aoc2023/day13}/main_test.go | 0 {day14 => aoc2023/day14}/example.txt | 0 {day14 => aoc2023/day14}/input.txt | 0 {day14 => aoc2023/day14}/main.go | 0 {day14 => aoc2023/day14}/main_test.go | 0 {day15 => aoc2023/day15}/example.txt | 0 {day15 => aoc2023/day15}/input.txt | 0 {day15 => aoc2023/day15}/main.go | 0 {day15 => aoc2023/day15}/main_test.go | 0 {day16 => aoc2023/day16}/example.txt | 0 {day16 => aoc2023/day16}/input.txt | 0 {day16 => aoc2023/day16}/main.go | 0 {day16 => aoc2023/day16}/main_test.go | 0 {day17 => aoc2023/day17}/example.txt | 0 {day17 => aoc2023/day17}/input.txt | 0 {day17 => aoc2023/day17}/main.go | 0 {day17 => aoc2023/day17}/main_test.go | 0 {day18 => aoc2023/day18}/example.txt | 0 {day18 => aoc2023/day18}/input.txt | 0 {day18 => aoc2023/day18}/main.go | 0 {day18 => aoc2023/day18}/main_test.go | 0 {day19 => aoc2023/day19}/example.txt | 0 {day19 => aoc2023/day19}/input.txt | 0 {day19 => aoc2023/day19}/main.go | 0 {day19 => aoc2023/day19}/main_test.go | 0 {day20 => aoc2023/day20}/example1.txt | 0 {day20 => aoc2023/day20}/example2.txt | 0 {day20 => aoc2023/day20}/input.txt | 0 {day20 => aoc2023/day20}/main.go | 0 {day20 => aoc2023/day20}/main_test.go | 0 aoc2024/day01/example.txt | 0 aoc2024/day01/input.txt | 0 aoc2024/day01/main.go | 30 +++++++++++++++++++ aoc2024/day01/main_test.go | 41 ++++++++++++++++++++++++++ go.mod | 2 +- 92 files changed, 72 insertions(+), 1 deletion(-) rename {day01 => aoc2023/day01}/example1.txt (100%) rename {day01 => aoc2023/day01}/example2.txt (100%) rename {day01 => aoc2023/day01}/input.txt (100%) rename {day01 => aoc2023/day01}/main.go (100%) rename {day01 => aoc2023/day01}/main_test.go (100%) rename {day02 => aoc2023/day02}/example.txt (100%) rename {day02 => aoc2023/day02}/input.txt (100%) rename {day02 => aoc2023/day02}/main.go (100%) rename {day02 => aoc2023/day02}/main_test.go (100%) rename {day03 => aoc2023/day03}/example.txt (100%) rename {day03 => aoc2023/day03}/input.txt (100%) rename {day03 => aoc2023/day03}/main.go (100%) rename {day03 => aoc2023/day03}/main_test.go (100%) rename {day04 => aoc2023/day04}/example.txt (100%) rename {day04 => aoc2023/day04}/input.txt (100%) rename {day04 => aoc2023/day04}/main.go (100%) rename {day04 => aoc2023/day04}/main_test.go (100%) rename {day05 => aoc2023/day05}/example.txt (100%) rename {day05 => aoc2023/day05}/input.txt (100%) rename {day05 => aoc2023/day05}/main.go (100%) rename {day05 => aoc2023/day05}/main_test.go (100%) rename {day07 => aoc2023/day07}/example.txt (100%) rename {day07 => aoc2023/day07}/input.txt (100%) rename {day07 => aoc2023/day07}/input2.txt (100%) rename {day07 => aoc2023/day07}/main.go (100%) rename {day07 => aoc2023/day07}/main_test.go (100%) rename {day08 => aoc2023/day08}/example1.txt (100%) rename {day08 => aoc2023/day08}/example2.txt (100%) rename {day08 => aoc2023/day08}/example3.txt (100%) rename {day08 => aoc2023/day08}/input.txt (100%) rename {day08 => aoc2023/day08}/main.go (100%) rename {day08 => aoc2023/day08}/main_test.go (100%) rename {day09 => aoc2023/day09}/example.txt (100%) rename {day09 => aoc2023/day09}/input.txt (100%) rename {day09 => aoc2023/day09}/main.go (100%) rename {day09 => aoc2023/day09}/main_test.go (100%) rename {day10 => aoc2023/day10}/example1.txt (100%) rename {day10 => aoc2023/day10}/example2.txt (100%) rename {day10 => aoc2023/day10}/example3.txt (100%) rename {day10 => aoc2023/day10}/example4.txt (100%) rename {day10 => aoc2023/day10}/example5.txt (100%) rename {day10 => aoc2023/day10}/input.txt (100%) rename {day10 => aoc2023/day10}/main.go (100%) rename {day10 => aoc2023/day10}/main_test.go (100%) rename {day11 => aoc2023/day11}/example.txt (100%) rename {day11 => aoc2023/day11}/input.txt (100%) rename {day11 => aoc2023/day11}/main.go (100%) rename {day11 => aoc2023/day11}/main_test.go (100%) rename {day12 => aoc2023/day12}/example.txt (100%) rename {day12 => aoc2023/day12}/input.txt (100%) rename {day12 => aoc2023/day12}/main.go (100%) rename {day12 => aoc2023/day12}/main_test.go (100%) rename {day13 => aoc2023/day13}/example.txt (100%) rename {day13 => aoc2023/day13}/example00.txt (100%) rename {day13 => aoc2023/day13}/input.txt (100%) rename {day13 => aoc2023/day13}/input07.txt (100%) rename {day13 => aoc2023/day13}/main.go (100%) rename {day13 => aoc2023/day13}/main_test.go (100%) rename {day14 => aoc2023/day14}/example.txt (100%) rename {day14 => aoc2023/day14}/input.txt (100%) rename {day14 => aoc2023/day14}/main.go (100%) rename {day14 => aoc2023/day14}/main_test.go (100%) rename {day15 => aoc2023/day15}/example.txt (100%) rename {day15 => aoc2023/day15}/input.txt (100%) rename {day15 => aoc2023/day15}/main.go (100%) rename {day15 => aoc2023/day15}/main_test.go (100%) rename {day16 => aoc2023/day16}/example.txt (100%) rename {day16 => aoc2023/day16}/input.txt (100%) rename {day16 => aoc2023/day16}/main.go (100%) rename {day16 => aoc2023/day16}/main_test.go (100%) rename {day17 => aoc2023/day17}/example.txt (100%) rename {day17 => aoc2023/day17}/input.txt (100%) rename {day17 => aoc2023/day17}/main.go (100%) rename {day17 => aoc2023/day17}/main_test.go (100%) rename {day18 => aoc2023/day18}/example.txt (100%) rename {day18 => aoc2023/day18}/input.txt (100%) rename {day18 => aoc2023/day18}/main.go (100%) rename {day18 => aoc2023/day18}/main_test.go (100%) rename {day19 => aoc2023/day19}/example.txt (100%) rename {day19 => aoc2023/day19}/input.txt (100%) rename {day19 => aoc2023/day19}/main.go (100%) rename {day19 => aoc2023/day19}/main_test.go (100%) rename {day20 => aoc2023/day20}/example1.txt (100%) rename {day20 => aoc2023/day20}/example2.txt (100%) rename {day20 => aoc2023/day20}/input.txt (100%) rename {day20 => aoc2023/day20}/main.go (100%) rename {day20 => aoc2023/day20}/main_test.go (100%) create mode 100644 aoc2024/day01/example.txt create mode 100644 aoc2024/day01/input.txt create mode 100644 aoc2024/day01/main.go create mode 100644 aoc2024/day01/main_test.go diff --git a/day01/example1.txt b/aoc2023/day01/example1.txt similarity index 100% rename from day01/example1.txt rename to aoc2023/day01/example1.txt diff --git a/day01/example2.txt b/aoc2023/day01/example2.txt similarity index 100% rename from day01/example2.txt rename to aoc2023/day01/example2.txt diff --git a/day01/input.txt b/aoc2023/day01/input.txt similarity index 100% rename from day01/input.txt rename to aoc2023/day01/input.txt diff --git a/day01/main.go b/aoc2023/day01/main.go similarity index 100% rename from day01/main.go rename to aoc2023/day01/main.go diff --git a/day01/main_test.go b/aoc2023/day01/main_test.go similarity index 100% rename from day01/main_test.go rename to aoc2023/day01/main_test.go diff --git a/day02/example.txt b/aoc2023/day02/example.txt similarity index 100% rename from day02/example.txt rename to aoc2023/day02/example.txt diff --git a/day02/input.txt b/aoc2023/day02/input.txt similarity index 100% rename from day02/input.txt rename to aoc2023/day02/input.txt diff --git a/day02/main.go b/aoc2023/day02/main.go similarity index 100% rename from day02/main.go rename to aoc2023/day02/main.go diff --git a/day02/main_test.go b/aoc2023/day02/main_test.go similarity index 100% rename from day02/main_test.go rename to aoc2023/day02/main_test.go diff --git a/day03/example.txt b/aoc2023/day03/example.txt similarity index 100% rename from day03/example.txt rename to aoc2023/day03/example.txt diff --git a/day03/input.txt b/aoc2023/day03/input.txt similarity index 100% rename from day03/input.txt rename to aoc2023/day03/input.txt diff --git a/day03/main.go b/aoc2023/day03/main.go similarity index 100% rename from day03/main.go rename to aoc2023/day03/main.go diff --git a/day03/main_test.go b/aoc2023/day03/main_test.go similarity index 100% rename from day03/main_test.go rename to aoc2023/day03/main_test.go diff --git a/day04/example.txt b/aoc2023/day04/example.txt similarity index 100% rename from day04/example.txt rename to aoc2023/day04/example.txt diff --git a/day04/input.txt b/aoc2023/day04/input.txt similarity index 100% rename from day04/input.txt rename to aoc2023/day04/input.txt diff --git a/day04/main.go b/aoc2023/day04/main.go similarity index 100% rename from day04/main.go rename to aoc2023/day04/main.go diff --git a/day04/main_test.go b/aoc2023/day04/main_test.go similarity index 100% rename from day04/main_test.go rename to aoc2023/day04/main_test.go diff --git a/day05/example.txt b/aoc2023/day05/example.txt similarity index 100% rename from day05/example.txt rename to aoc2023/day05/example.txt diff --git a/day05/input.txt b/aoc2023/day05/input.txt similarity index 100% rename from day05/input.txt rename to aoc2023/day05/input.txt diff --git a/day05/main.go b/aoc2023/day05/main.go similarity index 100% rename from day05/main.go rename to aoc2023/day05/main.go diff --git a/day05/main_test.go b/aoc2023/day05/main_test.go similarity index 100% rename from day05/main_test.go rename to aoc2023/day05/main_test.go diff --git a/day07/example.txt b/aoc2023/day07/example.txt similarity index 100% rename from day07/example.txt rename to aoc2023/day07/example.txt diff --git a/day07/input.txt b/aoc2023/day07/input.txt similarity index 100% rename from day07/input.txt rename to aoc2023/day07/input.txt diff --git a/day07/input2.txt b/aoc2023/day07/input2.txt similarity index 100% rename from day07/input2.txt rename to aoc2023/day07/input2.txt diff --git a/day07/main.go b/aoc2023/day07/main.go similarity index 100% rename from day07/main.go rename to aoc2023/day07/main.go diff --git a/day07/main_test.go b/aoc2023/day07/main_test.go similarity index 100% rename from day07/main_test.go rename to aoc2023/day07/main_test.go diff --git a/day08/example1.txt b/aoc2023/day08/example1.txt similarity index 100% rename from day08/example1.txt rename to aoc2023/day08/example1.txt diff --git a/day08/example2.txt b/aoc2023/day08/example2.txt similarity index 100% rename from day08/example2.txt rename to aoc2023/day08/example2.txt diff --git a/day08/example3.txt b/aoc2023/day08/example3.txt similarity index 100% rename from day08/example3.txt rename to aoc2023/day08/example3.txt diff --git a/day08/input.txt b/aoc2023/day08/input.txt similarity index 100% rename from day08/input.txt rename to aoc2023/day08/input.txt diff --git a/day08/main.go b/aoc2023/day08/main.go similarity index 100% rename from day08/main.go rename to aoc2023/day08/main.go diff --git a/day08/main_test.go b/aoc2023/day08/main_test.go similarity index 100% rename from day08/main_test.go rename to aoc2023/day08/main_test.go diff --git a/day09/example.txt b/aoc2023/day09/example.txt similarity index 100% rename from day09/example.txt rename to aoc2023/day09/example.txt diff --git a/day09/input.txt b/aoc2023/day09/input.txt similarity index 100% rename from day09/input.txt rename to aoc2023/day09/input.txt diff --git a/day09/main.go b/aoc2023/day09/main.go similarity index 100% rename from day09/main.go rename to aoc2023/day09/main.go diff --git a/day09/main_test.go b/aoc2023/day09/main_test.go similarity index 100% rename from day09/main_test.go rename to aoc2023/day09/main_test.go diff --git a/day10/example1.txt b/aoc2023/day10/example1.txt similarity index 100% rename from day10/example1.txt rename to aoc2023/day10/example1.txt diff --git a/day10/example2.txt b/aoc2023/day10/example2.txt similarity index 100% rename from day10/example2.txt rename to aoc2023/day10/example2.txt diff --git a/day10/example3.txt b/aoc2023/day10/example3.txt similarity index 100% rename from day10/example3.txt rename to aoc2023/day10/example3.txt diff --git a/day10/example4.txt b/aoc2023/day10/example4.txt similarity index 100% rename from day10/example4.txt rename to aoc2023/day10/example4.txt diff --git a/day10/example5.txt b/aoc2023/day10/example5.txt similarity index 100% rename from day10/example5.txt rename to aoc2023/day10/example5.txt diff --git a/day10/input.txt b/aoc2023/day10/input.txt similarity index 100% rename from day10/input.txt rename to aoc2023/day10/input.txt diff --git a/day10/main.go b/aoc2023/day10/main.go similarity index 100% rename from day10/main.go rename to aoc2023/day10/main.go diff --git a/day10/main_test.go b/aoc2023/day10/main_test.go similarity index 100% rename from day10/main_test.go rename to aoc2023/day10/main_test.go diff --git a/day11/example.txt b/aoc2023/day11/example.txt similarity index 100% rename from day11/example.txt rename to aoc2023/day11/example.txt diff --git a/day11/input.txt b/aoc2023/day11/input.txt similarity index 100% rename from day11/input.txt rename to aoc2023/day11/input.txt diff --git a/day11/main.go b/aoc2023/day11/main.go similarity index 100% rename from day11/main.go rename to aoc2023/day11/main.go diff --git a/day11/main_test.go b/aoc2023/day11/main_test.go similarity index 100% rename from day11/main_test.go rename to aoc2023/day11/main_test.go diff --git a/day12/example.txt b/aoc2023/day12/example.txt similarity index 100% rename from day12/example.txt rename to aoc2023/day12/example.txt diff --git a/day12/input.txt b/aoc2023/day12/input.txt similarity index 100% rename from day12/input.txt rename to aoc2023/day12/input.txt diff --git a/day12/main.go b/aoc2023/day12/main.go similarity index 100% rename from day12/main.go rename to aoc2023/day12/main.go diff --git a/day12/main_test.go b/aoc2023/day12/main_test.go similarity index 100% rename from day12/main_test.go rename to aoc2023/day12/main_test.go diff --git a/day13/example.txt b/aoc2023/day13/example.txt similarity index 100% rename from day13/example.txt rename to aoc2023/day13/example.txt diff --git a/day13/example00.txt b/aoc2023/day13/example00.txt similarity index 100% rename from day13/example00.txt rename to aoc2023/day13/example00.txt diff --git a/day13/input.txt b/aoc2023/day13/input.txt similarity index 100% rename from day13/input.txt rename to aoc2023/day13/input.txt diff --git a/day13/input07.txt b/aoc2023/day13/input07.txt similarity index 100% rename from day13/input07.txt rename to aoc2023/day13/input07.txt diff --git a/day13/main.go b/aoc2023/day13/main.go similarity index 100% rename from day13/main.go rename to aoc2023/day13/main.go diff --git a/day13/main_test.go b/aoc2023/day13/main_test.go similarity index 100% rename from day13/main_test.go rename to aoc2023/day13/main_test.go diff --git a/day14/example.txt b/aoc2023/day14/example.txt similarity index 100% rename from day14/example.txt rename to aoc2023/day14/example.txt diff --git a/day14/input.txt b/aoc2023/day14/input.txt similarity index 100% rename from day14/input.txt rename to aoc2023/day14/input.txt diff --git a/day14/main.go b/aoc2023/day14/main.go similarity index 100% rename from day14/main.go rename to aoc2023/day14/main.go diff --git a/day14/main_test.go b/aoc2023/day14/main_test.go similarity index 100% rename from day14/main_test.go rename to aoc2023/day14/main_test.go diff --git a/day15/example.txt b/aoc2023/day15/example.txt similarity index 100% rename from day15/example.txt rename to aoc2023/day15/example.txt diff --git a/day15/input.txt b/aoc2023/day15/input.txt similarity index 100% rename from day15/input.txt rename to aoc2023/day15/input.txt diff --git a/day15/main.go b/aoc2023/day15/main.go similarity index 100% rename from day15/main.go rename to aoc2023/day15/main.go diff --git a/day15/main_test.go b/aoc2023/day15/main_test.go similarity index 100% rename from day15/main_test.go rename to aoc2023/day15/main_test.go diff --git a/day16/example.txt b/aoc2023/day16/example.txt similarity index 100% rename from day16/example.txt rename to aoc2023/day16/example.txt diff --git a/day16/input.txt b/aoc2023/day16/input.txt similarity index 100% rename from day16/input.txt rename to aoc2023/day16/input.txt diff --git a/day16/main.go b/aoc2023/day16/main.go similarity index 100% rename from day16/main.go rename to aoc2023/day16/main.go diff --git a/day16/main_test.go b/aoc2023/day16/main_test.go similarity index 100% rename from day16/main_test.go rename to aoc2023/day16/main_test.go diff --git a/day17/example.txt b/aoc2023/day17/example.txt similarity index 100% rename from day17/example.txt rename to aoc2023/day17/example.txt diff --git a/day17/input.txt b/aoc2023/day17/input.txt similarity index 100% rename from day17/input.txt rename to aoc2023/day17/input.txt diff --git a/day17/main.go b/aoc2023/day17/main.go similarity index 100% rename from day17/main.go rename to aoc2023/day17/main.go diff --git a/day17/main_test.go b/aoc2023/day17/main_test.go similarity index 100% rename from day17/main_test.go rename to aoc2023/day17/main_test.go diff --git a/day18/example.txt b/aoc2023/day18/example.txt similarity index 100% rename from day18/example.txt rename to aoc2023/day18/example.txt diff --git a/day18/input.txt b/aoc2023/day18/input.txt similarity index 100% rename from day18/input.txt rename to aoc2023/day18/input.txt diff --git a/day18/main.go b/aoc2023/day18/main.go similarity index 100% rename from day18/main.go rename to aoc2023/day18/main.go diff --git a/day18/main_test.go b/aoc2023/day18/main_test.go similarity index 100% rename from day18/main_test.go rename to aoc2023/day18/main_test.go diff --git a/day19/example.txt b/aoc2023/day19/example.txt similarity index 100% rename from day19/example.txt rename to aoc2023/day19/example.txt diff --git a/day19/input.txt b/aoc2023/day19/input.txt similarity index 100% rename from day19/input.txt rename to aoc2023/day19/input.txt diff --git a/day19/main.go b/aoc2023/day19/main.go similarity index 100% rename from day19/main.go rename to aoc2023/day19/main.go diff --git a/day19/main_test.go b/aoc2023/day19/main_test.go similarity index 100% rename from day19/main_test.go rename to aoc2023/day19/main_test.go diff --git a/day20/example1.txt b/aoc2023/day20/example1.txt similarity index 100% rename from day20/example1.txt rename to aoc2023/day20/example1.txt diff --git a/day20/example2.txt b/aoc2023/day20/example2.txt similarity index 100% rename from day20/example2.txt rename to aoc2023/day20/example2.txt diff --git a/day20/input.txt b/aoc2023/day20/input.txt similarity index 100% rename from day20/input.txt rename to aoc2023/day20/input.txt diff --git a/day20/main.go b/aoc2023/day20/main.go similarity index 100% rename from day20/main.go rename to aoc2023/day20/main.go diff --git a/day20/main_test.go b/aoc2023/day20/main_test.go similarity index 100% rename from day20/main_test.go rename to aoc2023/day20/main_test.go diff --git a/aoc2024/day01/example.txt b/aoc2024/day01/example.txt new file mode 100644 index 0000000..e69de29 diff --git a/aoc2024/day01/input.txt b/aoc2024/day01/input.txt new file mode 100644 index 0000000..e69de29 diff --git a/aoc2024/day01/main.go b/aoc2024/day01/main.go new file mode 100644 index 0000000..c0596d8 --- /dev/null +++ b/aoc2024/day01/main.go @@ -0,0 +1,30 @@ +package main + +import ( + "bufio" + _ "embed" + "fmt" + + aoc "go.sour.is/advent-of-code" +) + +// var log = aoc.Log + +func main() { aoc.MustResult(aoc.Runner(run)) } + +type result struct { + valuePT1 int + valuePT2 int +} + +func (r result) String() string { return fmt.Sprintf("%#v", r) } + +func run(scan *bufio.Scanner) (*result, error) { + + for scan.Scan() { + _ = scan.Text() + + } + + return &result{}, nil +} diff --git a/aoc2024/day01/main_test.go b/aoc2024/day01/main_test.go new file mode 100644 index 0000000..b55d509 --- /dev/null +++ b/aoc2024/day01/main_test.go @@ -0,0 +1,41 @@ +package main + +import ( + "bufio" + "bytes" + "testing" + + _ "embed" + + "github.com/matryer/is" +) + +//go:embed example.txt +var example []byte + +//go:embed input.txt +var input []byte + +func TestExample(t *testing.T) { + is := is.New(t) + scan := bufio.NewScanner(bytes.NewReader(example)) + + result, err := run(scan) + is.NoErr(err) + + t.Log(result) + is.Equal(result.valuePT1, 0) + is.Equal(result.valuePT2, 0) +} + +func TestSolution(t *testing.T) { + is := is.New(t) + scan := bufio.NewScanner(bytes.NewReader(input)) + + result, err := run(scan) + is.NoErr(err) + + t.Log(result) + is.Equal(result.valuePT1, 0) + is.Equal(result.valuePT2, 0) +} diff --git a/go.mod b/go.mod index cddf387..8c3d9e8 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module go.sour.is/advent-of-code -go 1.22.0 +go 1.23.2 require ( github.com/matryer/is v1.4.1