35

Congrats to everyone who took part, and thank you to everyone who contributed here, in the solutions and visualization threads.

If anyone knows of a similar event that runs during the year, please do reach out, I would be happy to run more events like this.

Happy new year!

top 4 comments
sorted by: hot top new old
[-] CameronDev@programming.dev 5 points 1 month ago

For a final bit of code to roast, here is the bot that posted the daily threads:

Bot code

use std::process::exit;
use chrono::{Datelike, Timelike};
use lemmy_client::lemmy_api_common::community::GetCommunity;
use lemmy_client::lemmy_api_common::person::Login;
use lemmy_client::lemmy_api_common::post::CreatePost;
use lemmy_client::{ClientOptions, LemmyClient};
use rand::seq::IndexedRandom;
use regex::Regex;

static TARGET_COMMUNITY: &str = "Advent_Of_Code@programming.dev";

async fn get_advent_emoji() -> String {
    let choices = ['๐ŸŽ„','๐ŸŽ','๐Ÿงฆ','๐Ÿ•ฏ','๐ŸŒŸ','โœจ','๐Ÿงธ','โ›„','โ˜ƒ','โ„','๐Ÿ”','๐ŸŽ…','๐Ÿคถ','๐Ÿง‘','๐ŸฆŒ','๐Ÿ‘ผ','๐Ÿ‘ช','๐Ÿฝ','๐Ÿฅ›','๐Ÿท','๐Ÿ—','๐Ÿฅง','๐Ÿฌ','๐Ÿซ','๐ŸŽถ','๐ŸŽถ','๐Ÿ””','๐ŸŽŠ','๐ŸŽ‰','๐Ÿ’ƒ'];
    choices.choose(&mut rand::rng()).unwrap().to_string()
}

async fn get_advent_title(year: i32, day: u32) -> String {
    let url = format!("https://adventofcode.com/%7B%7D/day/%7B%7D", year, day);

    let resp = reqwest::get(url).await.unwrap();
    let body = String::from_utf8(resp.bytes().await.unwrap().to_vec()).unwrap();

    let re = Regex::new(r"---(.*)---").unwrap();

    for (_, [line]) in re.captures_iter(&body).map(|c| c.extract()) {
        return line.trim().to_string();
    }

    panic!("could not find advent title - {body}");
}

#[tokio::main]
async fn main() {
    let time = chrono::Utc::now();
    let year = time.year();
    let day = time.day();

    if time.hour() != 5 {
        println!("Wrong time: {time}");
        exit(0);
    }

    let title = get_advent_title(year, day).await;
    println!("Title: {:#?}", title);

    post_to_lemmy(year, day, title).await;
}

async fn post_to_lemmy(year: i32, day:u32, challenge_title: String) {
    let emoji = get_advent_emoji().await;
    let post_title = format!("{emoji} - {year} DAY {day} SOLUTIONS - {emoji}");
    let post_body = format!("# {challenge_title}

## Megathread guidelines
- Keep top level comments as only solutions, if you want to say something other than a solution put it in a new post. (replies to comments can be whatever)
- You can send code in code blocks by using three backticks, the code, and then three backticks or use something such as https://topaz.github.io/paste/ if you prefer sending it through a URL

## FAQ
- What is this?: Here is a post with a large amount of details: https://programming.dev/post/6637268
- Where do I participate?: https://adventofcode.com/
- Is there a leaderboard for the community?: We have a programming.dev leaderboard with the info on how to join in this post: https://programming.dev/post/6631465");

    let mut client = LemmyClient::new(ClientOptions {
        domain: "programming.dev".to_string(),
        secure: true,
    });

    let auth = client.login(Login {
        username_or_email: "HARDCODED".to_string().into(),
        password: "HARDCODED".to_string().into(),
        totp_2fa_token: None,
    }).await.unwrap();

    client.headers_mut().insert("Authorization".to_string(),
                                format!("Bearer {}", auth.jwt.unwrap().to_string()));

    let community = client.get_community(GetCommunity {
        id: None,
        name: Some(TARGET_COMMUNITY.to_string()),
    }).await.unwrap();
    let community_id = community.community_view.community.id;

    client.create_post(CreatePost {
        name: post_title,
        community_id,
        url: None,
        body: Some(post_body),
        alt_text: None,
        honeypot: None,
        nsfw: None,
        language_id: None,
        custom_thumbnail: None,
    }).await.unwrap();

}

[-] mr_satan@lemmy.zip 3 points 1 month ago

I still have day 12 to do. Got stuck on day 10, refused to use third party solver and persevered. Day 11 was quite basic compared with 10.

[-] Pyro@programming.dev 2 points 1 month ago

Even though it wasn't remotely in my control, I love my nice even score this year.

[-] CameronDev@programming.dev 2 points 1 month ago

50 points more and it would be ten for every day of the year.

this post was submitted on 01 Jan 2026
35 points (100.0% liked)

Advent Of Code

1217 readers
1 users here now

An unofficial home for the advent of code community on programming.dev! Other challenges are also welcome!

Advent of Code is an annual Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like.

Everybody Codes is another collection of programming puzzles with seasonal events.

EC 2025

AoC 2025

Solution Threads

M T W T F S S
1 2 3 4 5 6 7
8 9 10 11 12

Visualisations Megathread

Rules/Guidelines

Relevant Communities

Relevant Links

Credits

Icon base by Lorc under CC BY 3.0 with modifications to add a gradient

console.log('Hello World')

founded 2 years ago
MODERATORS