My MacBook Pro (Retina, 15-inch, Mid 2015) can only update to Monterey 12.
Ventura 13 and newer don’t support my Mac. It seems Mac moves pretty fast;
Tahoe 26 oldest supported Mac is MacBook Pro (16-inch, 2019). The lack of upgrade constricts the dev environment that I can
set up. For example, the latest C# extension only supports Ventura 13 and
newer; and so I need a version older than 2.60.26. Using 2.55.29.
Update macOS on Mac - Apple Support.support.apple.com.
Accessed Oct 19, 2025.
core/release-notes at main · dotnet/core · GitHub.github.com.
Accessed Oct 19, 2025.
Update Debugger Packages and move macOS requirement to macOS 13 by WardenGnaw · Pull Request #7854 · dotnet/vscode-csharp · GitHub.github.com.
Accessed Oct 19, 2025.
Parsing Each garden plot grows only a single type of plant indicated by a single letter. This \(4 \times 4\) arrangement includes garden plots growing 5 different types of plants (labelled A, B, C, D, E).
AAAA BBCD BBCC EEEC The area of a region is the number of garden plots the region contains. The perimeter of a region is the number of sides of garden plots in the region that do not touch another garden plot in the same region....
Parsing The stones are in a line, with each stone having a number engraved on it.
namespace AoC2024; public static partial class PlutonianPebbles { public static IEnumerable<ulong> ReadStones(string filePath) { var line = File.ReadAllText(filePath).Trim(); return line.Split().Select(ulong.Parse); } } The snippet below contains a subtle bug. The using statement disposes the StreamReader at the end of the scope . This happens before the IEnumerable<ulong> is consumed. However, because ReadLine eagerly reads the content, there is no exception thrown....
The project uses modern C#. The user is an experienced programmer who has been writing C# for a year. Before that, the user mostly wrote imperative object oriented C++ code.
Reference concepts from https://learn.microsoft.com/en-us/dotnet/csharp/ where appropriate.
Beware of the user writing non idiomatic code, e.g., being too imperative where a declarative or functional programming approach might be better suited.
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....
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....
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?...
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?...
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?...
Data The computer appears to be trying to run a program, but its memory is corrupted. All of the instructions have been jumbled up!
It seems like the goal of the program is just to multiply some numbers. It does that with instructions like mul(X,Y) where X and Y are each 1-3 digit numbers. For instance, mul(44,46) multiplies 44 and 46 to get a result of 2024.
However, because the program’s memory has been corrupted, there are also invalid characters that should be ignored, even if they look like a mul instruction....
Data The unusual data consists of many reports, one report per line. Each report is a list of numbers called levels that are separated by spaces. For example:
7 6 4 2 1 1 2 7 8 9 9 7 6 2 1 1 3 2 4 5 8 6 4 4 1 1 3 6 7 9 To parse:
namespace AoC2024; public static partial class RedNosedReports { private static IEnumerable<IEnumerable<int>> GetReports(string filePath) { using StreamReader inputReader = new(filePath); string?...
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:...
Why doesn’t dchege711/blog@3483b54 add hyperlinks in
.cscode comments?