Random Link ¯\_(ツ)_/¯ | ||
Aug 23, 2025 | » | AoC 2024 Day 08: Resonant Collinearity
4 min; updated Aug 23, 2025
Parsing Each antenna in the map is tuned to a frequency indicated by a single lowercase letter, uppercase letter, or digit. Two antennas with the same frequency create two collinear antinodes on either side where one of the antennas is twice as far away as the other, e.g. .......... ...#...... .......... ....f..... .......... .....f.... .......... ......#... .......... .......... Antinodes can occur at locations that contain other antennas.... |
Aug 23, 2025 | » | AoC 2024 Day 07: Bridge Repair
6 min; updated Aug 23, 2025
Parsing Each line represents a single equation, e.g., 292: 11 6 16 20. Part One needs to make a decision based on each line independently. Parsing each line into a data structure and yielding that should suffice. using System.Collections.Immutable; using System.Text.RegularExpressions; namespace AoC2024; public partial class BridgeRepair { public static IEnumerable<CalibrationEquation> Parse(string filePath) { using var inputReader = new StreamReader(filePath); string? line; while ((line = inputReader.ReadLine()) != null) { var numbers = InputLineRegex.... |
Aug 23, 2025 | » | AoC 2024 Day 06: Guard Gallivant
4 min; updated Aug 23, 2025
Parsing The map shows the current position of the guard with ^ (to indicate the guard is facing up from the perspective of the map). Any obstructions - crates, desks, alchemical reactors, etc., are shown as #. ....#..... .........# .......... ..#....... .......#.. .......... .#..^..... ........#. #......... ......#... using System.Collections.Immutable; namespace AoC2024; public partial class GuardGallivant { public enum Orientation { Up, Right, Down, Left } public readonly record struct Coordinate(int R, int C); public readonly record struct Visit(Coordinate Coordinate, Orientation Orientation); public readonly (int RowCount, int ColCount, HashSet<Coordinate> Obstacles) AreaMap; public readonly Visit StartingPosition; public GuardGallivant(string filePath) { using StreamReader inputReader = new(filePath); HashSet<Coordinate> obstacles = []; Visit?... |
Aug 23, 2025 | » | AoC 2024 Day 05: Print Queue
3 min; updated Aug 23, 2025
Parsing The notation X|Y means that if both page number X and page number Y are to be produced as part of an update, page number X must be printed at some point before page number Y. The input contains page ordering rules (pairs of X|Y) and print queues (e.g., 75, 47, 61, 53, 29). using System.Collections.Immutable; using System.Text.RegularExpressions; namespace AoC2024; public partial class PrintQueue { public readonly Dictionary<int, HashSet<int>> orderingRules = []; public readonly ImmutableList<ImmutableList<int>> printJobs = []; public PrintQueue(string filePath) { using StreamReader inputReader = new(filePath); string?... |
Aug 23, 2025 | » | AoC 2024 Day 04: Ceres Search
5 min; updated Aug 23, 2025
Problem This word search allows words to be horizontal, vertical, diagonal, written backwards, or even overlapping other words. Here are a few ways XMAS might appear, where irrelevant characters have been replaced with .: ..X... .SAMX. .A..A. XMAS.S .X.... The actual word search will be full of letters instead. For example: MMMSXXMASM MSAMXMSMSA AMXSXMAAMM MSAMASMSMX XMASAMXAMM XXAMMXXAMA SMSMSASXSS SAXAMASAAA MAMMMXMMMM MXMXAXMASX Parsing namespace AoC2024; public partial class CeresSearch { private readonly char[,] grid; public CeresSearch(string filePath) { using StreamReader inputReader = new(filePath); List<char[]> rows = []; string?... |
Jun 25, 2025 | » | AoC 2024 Day 01: Historian Hysteria
4 min; updated Jun 25, 2025
Day 1 - Advent of Code 2024: Historian Hysteria. Eric Wastl. adventofcode.com . Accessed Jun 25, 2025. Data There’s just one problem: by holding the two lists up side by side, it quickly becomes clear that the lists aren’t very similar. Maybe you can help The Historians reconcile their lists? For example: 3 4 4 3 2 5 1 3 3 9 3 3 To parse the input:... |
Jun 25, 2025 | » | Advent of Code 2024 - C#
(9 items)
LLM Instructions for Advent of Code Using C#; AoC 2024 Day 04: Ceres Search; AoC 2024 Day 05: Print Queue; AoC 2024 Day 06: Guard Gallivant; AoC 2024 Day 07: Bridge Repair; AoC 2024 Day 08: Resonant Collinearity; AoC 2024 Day 03: Mull It Over; AoC 2024 Day 02: Red-Nosed Reports; AoC 2024 Day 01: Historian Hysteria; |
Apr 12, 2022 | » | AoC 2021 Day 10: Syntax Scoring
2 min; updated Apr 12, 2022
Day 10 - Advent of Code 2021. Eric Wastl. adventofcode.com . Accessed Apr 12, 2022. Part I You ask the submarine to determine the best route out of the deep-sea cave, but it only replies: Syntax error in navigation subsystem on line: all of them The navigation subsystem is made of several lines containing chunks. There are one or more chunks on each line, and chunks contain zero or more other chunks.... |
Mar 16, 2022 | » | AoC 2021 Day 09: Smoke Basin
13 min; updated Mar 16, 2022
Multi-dimensional arrays using |
Mar 7, 2022 | » | AoC 2021 Day 08: Seven Segment Search
15 min; updated Mar 7, 2022
Day 8 - Advent of Code 2021. Eric Wastl. adventofcode.com . Accessed Mar 7, 2022. Part I Description You barely reach the safety of the cave when the whale smashes into the cave mouth, collapsing it. Sensors indicate another exit to this cave at a much greater depth, so you have no choice but to press on. As your submarine slowly makes its way through the cave system, you notice that the four-digit seven-segment displays in your submarine are malfunctioning; they must have been damaged during the escape.... |
Mar 5, 2022 | » | AoC 2021 Day 07: The Treachery of Whales
7 min; updated Mar 5, 2022
Day 7 - Advent of Code 2021. Eric Wastl. adventofcode.com . Accessed Mar 5, 2022. Part I Description A giant whale has decided that your submarine is its next meal, and it’s much faster than you are. There’s nowhere to run! Suddenly, a swarm of crabs (each in its own tiny submarine - it’s too deep for them otherwise) zooms in to rescue you! They seem to be preparing to blast a hole in the ocean floor; sensors indicate a massive underground cave system just beyond where they’re aiming!... |
Mar 1, 2022 | » | AoC 2021 Day 06: Lanternfish
12 min; updated Mar 1, 2022
Day 6 - Advent of Code 2021. Eric Wastl. adventofcode.com . Accessed Mar 2, 2022. Part I Description The sea floor is getting steeper. Maybe the sleigh keys got carried this way? A massive school of glowing lanternfish swims past. They must spawn quickly to reach such large numbers - maybe exponentially quickly? You should model their growth to be sure. Although you know nothing about this specific species of lanternfish, you make some guesses about their attributes.... |
Feb 25, 2022 | » | AoC 2021 Day 04: Giant Squid
6 min; updated Feb 25, 2022
Day 4 - Advent of Code 2021. Eric Wastl. adventofcode.com . Accessed Feb 25, 2022. Part One You’re already almost 1.5km (almost a mile) below the surface of the ocean, already so deep that you can’t see any sunlight. What you can see, however, is a giant squid that has attached itself to the outside of your submarine. Maybe it wants to play bingo ?... |
Feb 23, 2022 | » | AoC 2021 Day 03: Binary Diagnostic
14 min; updated Feb 23, 2022
Day 3 - Advent of Code 2021. Eric Wastl. adventofcode.com . Accessed Feb 23, 2022. Problem Description Part One The submarine has been making some odd creaking noises, so you ask it to produce a diagnostic report just in case. The diagnostic report (your puzzle input) consists of a list of binary numbers which, when decoded properly, can tell you many useful things about the conditions of the submarine.... |
Feb 19, 2022 | » | AoC 2021 Day 02: Dive!
12 min; updated Feb 19, 2022
Day 2 - Advent of Code 2021. Eric Wastl. adventofcode.com . Accessed Feb 19, 2022. Problem Statement Part One Now, you need to figure out how to pilot this thing. It seems like the submarine can take a series of commands like forward 1, down 2, or up 3: forward X increases the horizontal position by X units. down X increases the depth by X units.... |
Feb 18, 2022 | » | Advent of Code 2021 - Haskell
(16 items)
Learning Haskell via AoC 2021; AoC 2021 Day 01: Sonar Sweep; AoC 2021 Day 02: Dive!; AoC 2021 Day 03: Binary Diagnostic; AoC 2021 Day 04: Giant Squid; AoC 2021 Day 05: Hydrothermal Venture; AoC 2021 Day 06: Lanternfish; AoC 2021 Day 07: The Treachery of Whales; AoC 2021 Day 08: Seven Segment Search; AoC 2021 Day 09: Smoke Basin; AoC 2021 Day 10: Syntax Scoring; AoC 2021 Input Parser; AoC 2021 Main; AoC 2021 Solution Runner; AoC 2021 Test Code; AoC 2021 Parsing Arguments; |
Feb 18, 2022 | » | AoC 2021 Day 01: Sonar Sweep
6 min; updated Feb 18, 2022
Day 1 - Advent of Code 2021: Sonar Sweep. Eric Wastl. adventofcode.com . Accessed Feb 18, 2022. Part One As the submarine drops below the surface of the ocean, it automatically performs a sonar sweep of the nearby sea floor. On a small screen, the sonar weep report (your puzzle input) appears: each line is a measurement of the sea floor depth as the sweep looks further and further away from the submarine.... |