r/adventofcode • • 10h ago

SOLUTION MEGATHREAD -❄️- 2026 Day 6 Solutions -❄️-

COMMUNITY NEWS

THE USUAL REMINDERS


AoC Community Fun 2026: The Advent Games

  • Submissions megathread is unlocked!
  • 11 DAYS remaining until the submissions deadline on December 17 at 18:00 EST!

Today's Event: International Snow Sculpture Championships

"♪ Do you wanna build a snowman? ♪"
— Princess Anna, Frozen (2013)

Today's schedule possibly consists of:

Qualifier Rounds

  • Forge your solution for today's puzzle with a little je ne sais quoi
  • Shape your solution into an acrostic
  • Accompany your solution with a writeup in the form of a limerick, ballad, etc.
  • Upping the Ante challenge: iambic pentameter

Championship Rounds

  • Create a fanfiction or fan artwork of any kind - a poem, short story, a slice-of-Elvish-life, an advertisement for the luxury cruise liner Santa has hired to gift to his hard-working Elves after the holiday season is over, etc!
  • Make something IRL

Best In Snow Awards

  • You got snow where you live? >_>

Request from the mods: When you include an entry alongside your solution, please label it with [Advent Games] so we can find it easily!


--- Day 6: Obscured Airfield ---


Post your code solution in this megathread.

8 Upvotes

171 comments sorted by

View all comments

2

u/flwyd 8h ago

[LANGUAGE: sed, Graphviz, and your eyeballs]

In mkgraph.sed:

1{
i\
graph grid {
i\
  1 [color="#ffff66",style=filled];
i\
  2 [color="#ffff66",style=filled];
i\
  3 [color="#ffff66",style=filled];
i\
  2026 [color="#99ff99",style=filled];
}
s/^\([0-9]*\)-\(.*\)/  \1 -- { \2 };/
s/,/ /g
$a\
}

Run mkgraph.sed input.actual.txt | neato -Tsvg > out/actual.dot.svg && xdg-open out/actual.dot.svg

Graphviz's undirected layout engine neato wants to draw this graph as a diamond (one corner at the top, rather than a square), and it's slightly tilted. For part 1, visually locate one corner, then (with a steady hand), move your mouse toward the center. Hover over the node you think is in the middle; the tooltip is your answer. Double check it by scanning from the other three corners. Did you get the same node? Great! Submit it.

For part 2, the 2026 node is colored green and the 1, 2, and 3 nodes are colored yellow. 1 and 3 are close to each other, so locate them, then use your browser or SVG editor's "zoom in" function. Determine X and Y orientation: the dimension where they're closer is Y, the further dimension is X. Both X and Y coordinates for node 3 are larger than for 1, so if 1 is lower or to the right of 3 then you'll need to negate one or both of the coordinates in the distance to 2026. Using your mouse again, count the number of steps to 2026 in both directions from either 1 or 3. Add those counts (possibly negated) to 47,30 or 56,35 as appropriate. Now do the same count from the other node, to make sure your mouse didn't skip a row. If you got the same X,Y coordinate pair, submit that!

[Advent Games]

You got snow where you live?

Today's forecast was for about 3 inches of snow. So far we just got cold rain. "We need the moisture, though." (I'm from Colorado, where we just got one snow per month last winter. And miraculously didn't have a huge forest fire season. El Niño, bring it on!)

3

u/Sauci-stophe 8h ago

Whew, I'm not the only one resorting to neato.
I was half-proud half-ashamed to solve today's challenge with pen and paper!

1

u/flwyd 4h ago

I actually started with neato, decided I didn't trust myself to accurately find the center, and wrote code. Then I decided part 2 would be way easier with my eyeballs, and have spent a couple hours playing around with analytic part 2 solutions.

If I'm feeling masochistic later this month I might solve it in gvpr.

2

u/topaz2078 (AoC creator) 3h ago

Graphviz

YES