#AdventofCode

Wayne’s The Name!!!😁engineerminded@techhub.social
2026-02-02

I recommend #EverybodyCodes for everyone who loved #AdventOfCode. The #coding challenges arfe great. 75% of the way through #programming #python

David Brownmanxavdid
2026-02-01

Here's my 2025 day 3 solution (in , per usual)! An extra clean little dynamic programming problem.

advent-of-code.xavd.id/writeup

David Brownmanxavdid
2026-01-28
2026-01-27

And now we solved the sixth day in clojure!

The second part felt a bit hacky because we just built a string that evaluates to the correct code, but it worked on the first try!

As the problems now get more and more difficult, we get faster by using proper languages and not trying to do everything in butterflies.

#adventOfCode #clojure

Short clojure program using a lot of variables and a weird repetition of string parsing and string generation.
2026-01-26

We solved the fifth day of advent of code – in nu shell script!

It's a very friendly shell where all data is structured. It worked really nicely for an advent of code task.
We even managed to use recursion, although the default recursion limit doesn't seem like it's intended to be used. :3

#AdventOfCode #nuShell

Screenshot of a terminal window running nu shell. There are happy and intense colors.
First you see some lines of the end of a table with numbers. In the last line, the headings ("from" and "to") are repeated. Then there's a prompt with a file path, and the command "source 05b.nu". This is followed by an error message, which is expressive and beautifully formatted. Then another prompt with the same command (one can infer that the error has been corrected in the meantime), and a table with numbers.
2026-01-25

Thanks to the Devon weather I've now completed the first 17 days of #AdventOfCode 2020. The weather forecast for next week looks grim too ...

Oinak :ruby:oinak@ruby.social
2026-01-22

I started refactoring #adventOfCode Day 9 in #ruby and in this case I opted for extracted auxiliary modules (Memoize) and classes(Point and Rectangle).
Unusual for AoC but satisfactory.

# auxiliary classes and modules code:

Point = Data.define(:x, :y)

Rectangle = Data.define(:corner1, :corner2) do
  def area
    ((corner2.x - corner1.x).abs + 1) * ((corner2.y - corner1.y).abs + 1)
  end

  def xy_bounds
    x_min, x_max = [corner1.x, corner2.x].minmax
    y_min, y_max = [corner1.y, corner2.y].minmax
    [x_min, x_max, y_min, y_max]
  end
end

# intentionally naive for argless methods
module Memoize
  def memoize(name)
    original = instance_method(name)
    ivar_name = "@#{name}"
    define_method(name) do
      if instance_variable_defined?(ivar_name)
        instance_variable_get(ivar_name)
      else
        instance_variable_set(ivar_name, original.bind(self).call)
      end
    end
  end
end# Advent of code - Day 9
class MovieTheater
  extend Memoize

  attr_reader :corners

  def initialize(filename)
    @corners = File.readlines(filename).map do |line|
      x, y = line.strip.split(',').map(&:to_i)
      Point[x, y]
    end
  end

  def solution(advanced: false) = advanced ? max_inscribed_rectangle : largest_area

  # Part 1
  def largest_area = all_rectangles.map(&:area).max

  # Part 2
  def max_inscribed_rectangle = sorted_rectangles.rfind { inscribed?(it) }&.area || 0

  private

  memoize def all_rectangles = corners.combination(2).map { |pair| Rectangle[*pair] }

  # Part 2
  def sorted_rectangles = all_rectangles.sort_by(&:area)

  def inscribed?(rect)
    x_min, x_max, y_min, y_max = rect.xy_bounds
    !intersects_rows?(x_min, x_max, y_min, y_max) && !intersects_cols?(x_min, x_max, y_min, y_max)
  end

  def intersects_cols?(x_min, x_max, y_min, y_max)
    col_spans.any? do |x, (c_min, c_max)|
      next false unless x > x_min && x < x_max

      c_max > y_min && c_min < y_max
    end
  end

  def intersects_rows?(x_min, x_max, y_min, y_max)
    row_spans.any? do |y, (r_min, r_max)|
      next false unless y > y_min && y < y_max

      r_max > x_min && r_min < x_max
    end
  end

  memoize def row_spans = corners.group_by(&:y).transform_values { |cs| cs.map(&:x).minmax }
  memoize def col_spans = corners.group_by(&:x).transform_values { |cs| cs.map(&:y).minmax }
end
2026-01-21

My goodness the weather in Ottery is hideous today (and has been all week). As my normal outdoor activities have been curtailed, I've started #AdventOfCode 2020 in #Fortran 77 (mostly). 11 days completed so far. I wonder if I'll get to the end before the weather perks up? Having looked at the forecast for the next few days it's a distinct possibility! #RetroComputing

github.com/psychotimmy/aoc2020

2026-01-20

Juan Vazquez and Cameron Cunning rejoin the show to discuss how we fared with the 2025 Advent of Code competition.

#rust #elixirlang #dlang #Aoc2025 #AdventOfCode #programming

straypointers.com/e/s4e01.htm

2026-01-16

I just completed all 12 days of Advent of Code 2025!
#AdventOfCode #commonlisp #common_lisp adventofcode.com/

github.com/argentcorvid/aoc-20

well, I guess i did it. I had no idea how to do part 2 of day 10, so I translated the dijkstra approach from the reddit thread from python.

2026-01-15

Doing #AdventOfCode again. Working my way through 2020 and playing with numbers again.

Lot's of hand written numbers on a notepad written with a mechanical pencil.
🄼🅁🄱🅄🅂🅂🅈🇳🇱🇪🇺mrbussy@fosstodon.org
2026-01-15

I just completed "Laboratories" - Day 7 - Advent of Code 2025 #AdventOfCode adventofcode.com/2025/day/7

ednl 🇪🇺ednl
2026-01-13

I revisited 2025 day 8 which was very slow, relatively speaking, because I sorted the whole list of one million distances between distinct pairs, just to get the top 5500 smallest values. So I finally made a "topn()" function which works the same as the qsort standard library function, but with one extra parameter 'n' to get that Top N.

Runtime went from 33 milliseconds down to 10 milliseconds.

Source code in C of my new library function: github.com/ednl/adventofcode/b

C source code from https://github.com/ednl/adventofcode/blob/main/topn.c
2026-01-13

Wish us luck

#adventOfCode

Ein Screenshot eines Terminals; es wird in den Ordner "advent-of-code-2025" gewechselt und dann ein neuer Ordner namens "03-assembler" angelegt. Das deutet darauf hin, dass wir die dritte Aufgabe des Advent of Code mit Assembler lösen wollen. Assembler ist eine sehr alte, unpraktische und "maschinennahe" Programmiersprache, das heißt, dass eins mit Assembler schon fast bei den Nullen und Einsen ist.
David Brownmanxavdid
2026-01-13

Better late than never, but I've got a solution post up for 2025 day 1 in . It turns out babies make you tired?? But we got there anyway.

advent-of-code.xavd.id/writeup

2026-01-12

Aaaaah, the horrors, what a nice evening! @blinry and I finished day 2 of the advent of code in sqlite.

As you probably guessed, the screenshot only shows the lower third of the program, there's more "with recursive" where that came from :>

This is not good code, don't try this at home. We wanted the pain.

#aoc #aoc25 #adventOfCode #sqlite

Ein Screenshot von SQL-Code. Oben sind vier "with recursive"-Blöcke sichtbar, die jeweils Zahlen generieren und in eine Tabelle schreiben. Das eigentliche Fleisch des Programms sind die zwei untersten Zeilen, in denen start- und stop-Werte aus einer Liste generiert werden, alle vorher generierten Zahlen überprüft werden, ob sie sowohl größer als start und kleiner als stop sind, und, wenn ja, dann alle addiert werden.
Stéphane Trebelstephanetrebel
2026-01-12

Moi qui lis ce matin un nouvel article de Making Software (makingsoftware.com/) sur une propriété de SVG (fill-rule), et…je ralentis la lecture…et…ATTENDEZ UNE MINUTE 🤯

C'est quoi, ça, le "Winding Algorithm" ? Ah, bah oui, ça pourrait m'être utile, ça 😅

Résumé : SVG fill-rule et algorithmes de remplissage
Cette image est tirée d'un article de Making Software par Dan Hollick qui explique pourquoi l'attribut SVG fill-rule a des valeurs apparemment étranges.
Le problème abordé
L'attribut fill-rule en SVG peut prendre deux valeurs : nonzero et evenodd. Ces noms semblent cryptiques mais ils correspondent en réalité à deux algorithmes différents pour déterminer quelles zones d'un polygone doivent être remplies.
Les deux algorithmes
L'article présente visuellement (avec des étoiles à 5 branches) comment ces algorithmes fonctionnent :

Ray-casting (lancer de rayon)
Winding number (nombre d'enroulement)

Ces deux approches sont des méthodes couramment utilisées pour tester si un point donné se trouve dans un polygone.
2026-01-12

Health and general disgust with the news are distracting me from my "learn #Forth by doing #Adventofcode" work. Stops, starts, tear downs, rewrites. No, the problems aren't that hard (yet, I gather days things get hairy from days 8 to 10).

I've seen at least one other Forth user. Someone did all the days in x86 assembly language--the men in their nice white coats will be coming for them soon--a lot of Python, the usual number of Brainf_ckers, and something I didn't know existed: Shakespeare Programming Language (SPL). Tres cool as we used to say.

Aside: I need to learn how to do accented characters. Sorry, I'm a dumb American.

ednl 🇪🇺ednl
2026-01-12

I posted an explainer for one of the early puzzles: day 10 of the first year 2015. The puzzle asked to calculate the length of "look-and-say" sequences and the naive solution, a literal translation of the look-and-say algo, worked even for part 2 if a bit slow. But time and space blow up exponentially via Conway's Constant, so going much further was impossible. Not with this new approach which uses the atomic elements, is fixed size and runs in O(n).

redd.it/1qaha10

2026-01-11

I just completed "Gift Shop" - Day 2 - Advent of Code 2025 adventofcode.com/2025/day/2

Client Info

Server: https://mastodon.social
Version: 2025.07
Repository: https://github.com/cyevgeniy/lmst