Grilled Cheese

ExploreLog inSign up
Terms of UsePrivacy PolicyCommunity StandardsHelpGet the app

Grilled Cheese is a product of Village Compute

Version devBuilt at: 2026-12-03 22:42:33 EST

PhotosVideosAllPeople
LatestRanked
Photo, no description
Titelfolie mit dem Etikett Kalenderblatt: Heute startet Advent of Code. Ein Adventkalender zum Programmieren. Kleines gezeichnetes Porträt von Prof. Aufner.
Photo, no description
Original cartoon by Brian Uri.

Advent of Code Day 0 Puzzle: Figuring out when midnight on December 1 occurs

A man stands in front a chalkboard with time-related scribbles all over it. Yarn connects a calendar to an analog clock to a sundial.
Announcement card for adventofcode 26.2: "Solve, submit and benchmark your Advent of Code puzzles in Python". It lists three features: adventofcode login to set up your session cookie once for every year, better benchmarks that show your fastest solution per day, and puzzles that keep their highlights. Below them is the install command, uv add adventofcode. On the right, a terminal runs uv run adventofcode benchmark on the 2025 solutions: 17 solution files with part 1, part 2 and total times, slower variants dimmed, for a total of 24 stars in 6.41ms. A yellow sticker says 08-numpy.py is 1,295× faster than 08.py.
Photo, no description
import kodvent.graph.*
import kodvent.grid.*

data class Reindeer(val position: Position, val direction: Direction)

fun solve(input: List<String>): Pair<Int, Int> {
    val maze = input.toGrid()
    val start = Reindeer(maze.positionOf('S'), Direction.RIGHT)
    val ends = Direction.entries.map { Reindeer(maze.positionOf('E'), it) }

    fun Reindeer.moves(next: Position) = listOfNotNull(
        copy(direction = direction.turnLeft()) to 1000,
        copy(direction = direction.turnRight()) to 1000,
        (copy(position = next) to 1).takeIf { maze[next] != '#' },
    )

    val fromStart = dijkstra(start) { it.moves(it.position + it.direction) }
    val toEnd = dijkstra(starts = ends) { it.moves(it.position - it.direction) }

    val best = ends.minOf { fromStart.getValue(it) }
    val onBestPath = fromStart.keys.filter { fromStart.getValue(it) + toEnd.getValue(it) == best }
    return best to onBestPath.map { it.position }.toSet().size
}
Screenshot of text: "1 101:39:28." (About 101 hours until the Day 1 puzzle unlocks at Advent of Code.)
Advent of Code
A screenshot of the AoC website, showing 112 hours, 12 minutes, and 21 seconds to go until the first puzzle unlocks
Hand in cast.
Photo, no description
Hand with stupid amounts of bandaging
Collage of Advent of Code solutions on CP/M