I love AoC! Did it the last 2-3 years in Rust, hanging out in a discord where we all try to make the absolute fastest solutions. Learnt all kinds of crazy performance hacks and some advanced algorithms & SIMD that way.<p>This time I'm trying to do them in Rust and Golang in an effort to either learn to like/tolerate Golang (because we use it at work) or prove my hypothesis that it sucks and never use it unless I have to.
Interested by your rust speed approaches, care to share a link ?
Same. I am doing rust + clojure this year. Very interested in performance hax, esp around SIMD. I know absolutely nothing at all about rust, this is my first time working with it.<p>My day 1 rust solution:<p><pre><code> cargo solve 1 --
release
Finished `release` profile [optimized] target(s) in 0.05s
Running `target/release/01`
Part 1: 1189304 (95.8µs)
Part 2: 24349736 (120.4µs)
</code></pre>
Day 1 clojure solution:<p><pre><code> lein run 1
running all tasks for day 1
reading input from resources/day01.txt
running day 1 part 1
part-fn: #'aoc.day-01/part-1
took: 5.511375 ms
result: 1189304
reading input from resources/day01.txt
running day 1 part 2
part-fn: #'aoc.day-01/part-2
took: 1.822334 ms
result: 243497365
</code></pre>
Code here: <a href="https://github.com/whalesalad/aoc">https://github.com/whalesalad/aoc</a>
Are the timings with language runtime startup, or only the procedure calls of the actual code?
There's a Rust solution posted in the Reddit Day 1 answers mega thread which claims 22 microseconds part 1 and 10 microseconds part 2. (I haven't tried to verify):<p><a href="https://old.reddit.com/r/adventofcode/comments/1h3vp6n/2024_day_1_solutions/lzv90g1/" rel="nofollow">https://old.reddit.com/r/adventofcode/comments/1h3vp6n/2024_...</a>
Can't edit my comment, here's another claiming 12.7 μs and 7 μs:<p><a href="https://old.reddit.com/r/adventofcode/comments/1h3vp6n/2024_day_1_solutions/lzykfxp/" rel="nofollow">https://old.reddit.com/r/adventofcode/comments/1h3vp6n/2024_...</a><p>Another claiming 30μs and 32μs:<p><a href="https://old.reddit.com/r/adventofcode/comments/1h3vp6n/2024_day_1_solutions/lzydegd/" rel="nofollow">https://old.reddit.com/r/adventofcode/comments/1h3vp6n/2024_...</a>
Sure but how long did it take to compile
I 'git clone' and 'cargo run' and it downloaded 16 crates and compiled all the crates and built a debug version in 29.7 seconds.<p>Then 'cargo build --release' took 23.3 seconds.<p>Commenting out one of the sort_unstable lines and rebuilding gave me a warning, recompiled in 1.8 seconds.
'd you be interested in sharing the discord? :)<p>I try every year to optimize for speed in zig: <a href="https://github.com/ManDeJan/advent-of-code">https://github.com/ManDeJan/advent-of-code</a>
Sounds like a very interesting Discord to check :)
Go (not "Golang") has better compilation times than Rust and does not try to combine incompatible ways of using concurrency.<p>I have the opposite dilemma to you, I want to learn to like Rust.
Personally I loathe golang for the sheer fact that it was created recently enough to have included a much better design. Old languages get a pass.<p>Rust to me is what a modern take on a systems language would be. I think it’s substantially better than go.
Let's try to settle the Go/Rust debate in this AoC sub-thread ^_^
This years challenge for me: write it in C without the standard library or an allocator. Has to be runnable on an STM32 with 32kb of SRAM.<p>I tried doing it in Assembly two years ago, ended up spending hours and hours writing an Assembly standard library, then gave up and switched to Rust...
Last year I tried C on a real Amiga 1200 (using DICE, Matt Dillon’s compiler / runtime). I didn’t get very far, lack of memory protection makes things really hard.<p>This year the Amiga has an 060 upgrade with an MMU, so perhaps I can figure out how to use that and have another go.
Forgive the dumb question... it's been ages since I've done Amiga programming in C. What behaves differently? Is the lower K of memory mapped, such that null pointer deferences cause excitement rather than simply crashing your program? Or is it something else?
AmigaOS has no memory protection whatsoever. If your program crashes, so does the entire machine. And it will possibly bring your hard drive with it, too.<p>Not unworkable, but not the most relaxed environment for fast’n’fun cowboy coding. You typically have to reboot a lot.
I don't get it either, particularly as most advent challenges can be solved using just iso c and its standard library.
Heh. Yeah, a memfault tanking the machine is not conducive to iterative programming :o)
Just stop writing memfault.<p>I say it in jest but that's actually how I used to program a few years ago when I was working on large industrial pieces of software with long compilation time. You just have to be careful and check what you wrote before sending it to the machine.<p>I think "iterative" programming has made people really complacent when it comes to silly errors. Slowing down can often do wonder.
Guru Meditation anyone? (<a href="https://en.wikipedia.org/wiki/Guru_Meditation" rel="nofollow">https://en.wikipedia.org/wiki/Guru_Meditation</a>)
Honestly, I forgot all about that aspect of ancient programming. It probably made one more careful, or more patient. (Source: typing 6502 programs into a hex "monitor" which is a way to edit memory, view memory, and issue "jump to this memory address".)
Your restrictions sound quite challenging, good luck!<p>Last year I solved all the problems in C without <i>external</i> libraries [1] and I enjoyed it a lot. It forced me implement some low-level stuff that I had forgotten how to do (e.g. a heap) and to write some numerical routines myself (easier than you'd think!).<p>[1] <a href="https://github.com/sebastianotronto/aoc/tree/master/2023">https://github.com/sebastianotronto/aoc/tree/master/2023</a>
Symmetrically, I would consider only using sh and standard non-Turing-complete CLI tools (grep yes, awk no). About as limiting, but without devastating memory corruption bugs.
I think there might end up being some problems which will be very challenging to solve with those resource constraints - namely memory. You will probably have to be pretty clever with your solutions.<p>I remember one of my naive brute force solutions from last year ended up allocating gigabtyes of memory. There were obviously more efficient solutions, but some of the inputs are pretty large and so hefty allocations might be difficult to avoid.
Good luck! Personally, I'm still going with CL but decided to try it in all the languages I "know" for the first day. Including C which doesn't have hash tables (inb4 hsearch)... what a pain, let me tell you.<p><a href="https://git.sr.ht/~q3cpma/aoc2024/tree/master/item/01" rel="nofollow">https://git.sr.ht/~q3cpma/aoc2024/tree/master/item/01</a><p>If you could post a repo link so I can look at some of the progress, I'd be grateful.
POSIX `hsearch` is absolutely terrible and almost useless, but... it would get the job done for this problem.
The advantages of foregoing hsearch is that I don't have to understand its weird API that works only for NUL-terminated string keys and that I don't require POSIX.<p>Remember that brute force is also a solution in the AoC; had plenty of fun using SBCL to crack some problems where Pythonistas had to be clever, last year =)
- bsearch + qsort is a great way to implement associative tables<p>- you can implement a hash table in C in about 125 LOC and reuse it.<p>- hash tables are not the only way to solve problems. hammer/nail
> bsearch + qsort is a great way to implement associative tables<p>Only if you write/read your table in two separate passes. A tally needs mixed read/write to increment a counter, not just insertion, so it must be kept sorted during the table creation. Some kind of tree or linked list is probably better in this case.<p>> you can implement a hash table in C in about 125 LOC and reuse it.<p>I know. Anyone who uses C and never made at least a basic FNV1A/bucket-based hash table must be insane. But I wanted a small self-contained .c here and have become allergic to (void *); if I were to use C <i>seriously</i>, I'd fix it using a better preprocessor (à la <a href="https://github.com/etwyniel/c-generics">https://github.com/etwyniel/c-generics</a>).<p>> hash tables are not the only way to solve problems. hammer/nail<p>Eh, a tally seemed the most intuitive way for the 2nd part.
Also the TclHash table implementation is quite good and independent of the Tcl interpreter runtime.
I don't think there are enough entries to make it worth the cost of a hash. I know it's not "efficient" exactly, but just repeatedly looping through and counting just isn't that slow.
I just want to note that Quake 3 CPMA is one of the best games ever made. No idea if the handle is in reference to that, but thanks for the :)
As long as you can make an RPC call, anything is doable within 32kb of ram :-)
Glorious!<p>I think I'll follow in your footsteps. STM32F7 with 320k but with bare metal Rust :)
Do you have a public repo?
this is like trying to solve it in a computer built in turing complete
Ah here it is again, 25 days of writing increasingly complex input parsers.
the input parsers don't get increasingly complex over the days. The problems themselves do. Even on the most difficult days around 22 or 23, the inputs are all just lines of space separate ints or some grid of points or something, just like the trivial problems on days 1-3
Those are the problems I loathe the most, where the real problem is figuring out how to parse the input into something more workable. Once its parsed its ezpz.
Are you solving all puzzles? I find usually that the parsing isn't my problem, but some of the puzzles puzzle me (ha, couldn't resist), because they expect some kind of graph knowledge or some mathematical trick or so. Last year got stuck at day 17 for example. Usually some learning in it then, but parsing, while possibly annoying day after day, wasn't usually what stopped me from completing puzzles.
After a few days I cave and just use regex, which I of course forget every year and need to relearn.
It's input parsing with a fun story
i find ScanF and state machines are a lot more effective than split / explode style parsers.
Why isn’t the input a csv?
Claude will do it for you.
What is the point in doing a programming challenge if you aren't learning anything
Maybe I'm interested in solving the algorithmic problem and less interested in writing input parsers...
Depends if you're really stuck on a problem. I'd rather learn by getting a look at how it's done, even if the code is incorrect, than be completely suck with no idea why or what to do.
"Running a marathon is hard work, but a car will do it for you."<p>Sure, but then what's the point?
So will Fiverr. Who cares?
Why bother.
Aiming to get all the stars this year to round it out with 500 total - all the years, all the problems.<p>As of last week there were something around 1024 people who had all 450 stars.<p>Only started on like day 6 of 2022, but became hooked and had some time early in 2023 to go through the previous years. Once you have a few algorithms canned, it's not too difficult and some themes repeat across years.<p>It's fun to brush up on stuff you don't touch all the time - actual algorithms and stuff.<p>Hats off to the volunteers and Eric - I aim to donate every year now - it's a great event.
I usually do AoC in Common Lisp, but this year I'm giving Swift a chance.<p>It's not half bad at this kind of twiddling for being a statically typed mainstream language.<p><a href="https://github.com/codr7/aoc24/tree/main/swift/Sources/aoc">https://github.com/codr7/aoc24/tree/main/swift/Sources/aoc</a><p>This year is a tiny bit weird, I was just getting ramped up organizing the event at a new job; because I think it's very useful for devs to learn some real problem solving, as opposed to stitching frameworks.<p>And then I had to leave because my new boss turned out to be someone I couldn't imagine working with.<p>Guess it'll be just me and Emacs as usual.
Excellent! Come and join the Swift leaderboard here <a href="https://forums.swift.org/t/advent-of-code-2024" rel="nofollow">https://forums.swift.org/t/advent-of-code-2024</a> if you haven't already -- it's super interesting to compare different solutions.
Are you writing the solutions / compiling / running all with Emacs? I wanted to try Swift this year as well but feels sort of silly spinning up XCode for this.
I enjoyed reading your solutions! I’m surprised how terse they are!
dont you find all the string parsing and manipulation to be quite painful in Swift? I tried to do AoC in Swift before and that put me off a lot. I liked doing little functional one liners but a week from now the parsing burden will be too high.
Nah, the String type is fine as far as basic functionality goes, I like adding my own convenience stuff in extensions.<p>The language has been moving pretty fast though, I have a feeling a lot of features I find useful are relatively new.
Last year I got stuck on Day 12 for a full week, and thinking about how to solve it consumed my every waking moment. I think this year, I'm going to be kind to myself and not participate so I can really enjoy the winter break from work.
What's so hard about Day 12?
It's just<p><pre><code> +/'{x:".",x;H:(-1+;1+i-)@'+|\m*i:!#m:x=\:"#."
R:(x=x)({[h;d;x;y;z](z#0),+\(((-z)_~"#"=x)&z_d>z)*(*y),(-z+1)_y-0^y h}. H)[x]/y
(*|R)-R@*|0,&1_*+m}.''1({("?"/:5#,x;,/5#,y)}.')\@[;1;.:]'" "\:'0:`:i/12.txt</code></pre>
This is what programming languages looked like to me before I learned programming
I'm doing this year in K2 (after a long hiatus from K). Is there a K4/5 binary? ATW gave me a K2 binary, but I miss some of the K4 and later functionality):<p><a href="https://github.com/jnordwick/aok2024">https://github.com/jnordwick/aok2024</a>
Any idea how close that is to valid J code?
Is this Q? or k?
It's k4, the underlying language behind Q. With slight modifications it also runs in ngn/k which is FOSS.<p><a href="https://ngn.codeberg.page/k/#eJxVjsFugzAMhu95iiyWik1CIGPtIVGXHnvm2lA2qdLKgcsOU6C0z77QcZkt65c//7ZcMu+9BgBulFE106l7lvYAeoUe/mWideK7ZTXtJu9S/C0xs7Jn6D9druzUNl0B8GvwWr0mc2Cst9x0uAkPVCIEQY/SElT24/P764cbJsvsFq3QQkV3tFgY6YzsCzpkcg5D3tsXGGzcBytAC8Ybi3EfCW+nq7u46EY3tThBRUoGRCwm6h4CRLJspu7yPlGO+UgqDaShbiyq88ivd82PdIptOTKO+dxQ0RzyuVIb0+VyuOssM3hD4UW5hfSWWmSkxCkcTs44bdtMcBGy/hdgfU9G" rel="nofollow">https://ngn.codeberg.page/k/#eJxVjsFugzAMhu95iiyWik1CIGPtIVG...</a>
Looks like K to me!
It ate my life for a few years in a row, I even managed to finish on Christmas eve twice. Now I don't even look, it turns from fun to stress rather quickly.
I re-read the intro and the fact it mentions leetcode and the like was enough for me to decide that it's an ultimately pointless endeavour for me.<p>I have no interest at all in competitive programming or maths; I spend 40+ hours a week doing programming for work, I want games and challenges that pull me away from that so I continue to have a life outside of my job.
For what it's worth, I <i>hate</i> leetcode with a burning passion, have no real interest in math, and yet I personally find Advent of Code quite fun and enjoyable.
I have found AoC fun, but on some of the later days time constraints make it a little stressful (full time job + kids constrain my time).<p>I've done it (and completed it) the last five years. I used it to try out a few languages (Haskell, Idris, Lean) and did it in python one year I was feeling lazy. I've got a project going now, and I probably should do that instead.<p>However, that project is a programming language, so this is a way to test practicality. But solving problems and fixing shortcomings in the underlying language at the same time may be a bit too much. (It's a dependent typed language, so there is a lot of subtlety to deal with.)
Same, I've been coding for 40 years and I still learn plenty every year.
Solving the puzzles in a REPL in a dynamic language brings a lot of joy to AOC.<p>My daily grind is like carefully scaffolding and repainting a 50 storey office building made of typed, modular, spaghetti couples Python ML code.<p>AOC in ipython, by comparison, is like doodling pictures with a brush pen!<p>It is very enjoyable and also why leetcode is a little silly for interviews: convince me you can I want to know a candidate can flawlessly paint several hundred square feet of wall, not doodle a cat cartoon.<p>(Or, away from the analogy, the software equivalents. Can you safely progress business goals as a member of a team on a legacy codebase that’s partly evolving on the cutting edge and also partly rotting on the trailing edge? I don’t care if you can build a naive implementation of our trading system… sorry I mean an Elephant Auction… in 90 minutes!)
I find it useful for trying new languages. The first 10 days usually start very easily and progress quite gradually. The 2nd half definitely gets more brutal, but if you do have the self-control, you can stop whenever it stops being productive.
How about something creative that is at the same time relaxing?<p>Some time ago I started creating mods for the game stardew valley. It still involves some programming but mainly drawing, creating animations and composing music! It's an absolute blast and so relaxing (like the game itself).<p>I think by now I could even start working on my own game but I don't yet have a desire to.
Not the OP but as someone with the same mindset as them:<p>Sounds very fulfilling, but I explicitly want to stay as far away from tech as possible outside of working hours. I'd much rather draw and compose music outside of any tech environment.<p>Plus, creative hobbies are an amazing way to connect with people, it's half the reason I like them. Tech hobbies are going to make me connect with tech people which isn't what I want: I meet enough tech people at work, I'd end up talking about tech (languages, frameworks, software, AI...) outside of work which have no interest in, and I don't really relate to tech people anyway (as a sweeping statement that obviously isn't an absolute)
Not OP, but that’s really neat. What’s your process for that? What IDE for the coding? Is C# required? What software for the art?
I started with something called ContentPatcher. It let's you patch game assets and other stuff (including some logic) using a json based DSL.<p>For more complex things C# is needed as Stardew Valley is made with XNA/MonoGame. There is a NuGet package to set it up which even includes hot reloading of the mod into the running game: <a href="https://www.nuget.org/packages/Pathoschild.Stardew.ModBuildConfig" rel="nofollow">https://www.nuget.org/packages/Pathoschild.Stardew.ModBuildC...</a><p>I use NeoVim but you can use any editor. It was a bit of a pain to get dotnet going on arch linux but I got it working after some tinkering.<p>To get started, one can install SMAPI, then unpack the game assets. Then, you can open game maps and assets in the Tiled level editor. I also use Aseprite to make the pixel art tilesets for the maps (LibreSprite would also work). I use a mix of my own tiles and tiles from the game itself for my maps. Music and sound can also be added or patched with ContentPatcher. I make all sound related stuff with Ableton Live. I haven't done much with C# yet but SMAPI provides a pretty nice API so it should be pleasant to use.
An offline version could be an "Exit" advent calendar game. Now that advent has started, you might find them discounted at a local board game shop.<p>Note it's a single-use game.<p><a href="https://boardgamegeek.com/geeksearch.php?action=search&objecttype=boardgame&q=Exit%20Adventskalender" rel="nofollow">https://boardgamegeek.com/geeksearch.php?action=search&objec...</a><p>(I don't see any reference to leetcode, but people can approach Advent of Code however they like. I'm certainly not waking up at 5:50 to race for a solution.)
I go in to this not caring how fast I do it, or how far behind I get. It's just an opportunity to learn something and challenge myself a little bit.<p>At best, I tend to set myself an upper limit for runtime.
Advent of Code is traditionally parsing heavy and very light on actual mathematics. It’s not very leetcody.<p>If you have never tried it you should definitely give it a go. It’s quite enjoyable at a moderate dosage.
The don't do it. Thanks for the update though
I have enough side projects on the back burner as it is. I even picked up a data processing one over thanksgiving.
I have enough fun side project ideas that I want to do. Ones which will also be helpful for me once I’m done with them.
Only year I ever completed it it took eight months.<p>I’m not seeing my name on a leaderboard any time soon.
I just do the puzzles until it stops being fun. For me that's usually around day 14.
Sounds sensible. It's important to set boundaries, and enjoy time off.<p>For me Advent of Code is a slippery slope. The difficulty ramps up so at first it's easy, then it's rewardingly difficult. But then before I know it, it takes wayyyyy too much time. The danger is being emotionally invested by then.
There's a graph here of the "hardness" of each day/task, based on how long the 100th place on the leaderboard used. <a href="https://aoc.xhyrom.dev/" rel="nofollow">https://aoc.xhyrom.dev/</a><p>So it's not linear, and also based on your own knowledge. So perfectly fine to skip some days and still it's possible to solve some of the next ones!
> So perfectly fine to skip some days and still it's possible to solve some of the next ones!<p>You try telling that to my brain. That guy doesn’t listen to me.
Either the problems are getting easier each year, or perhaps there are just more people participating which drives down the 100th-place times.
There are some "filter" days for sure, usually those are when the solution needs a major leap in your approach such as concurrency, dynamic programming, or geometry equations.
It's usually not concurrency FWIW, it's almost always algorithmic in nature. On a modern machine, even highly concurrent* code would only execute 10-20x as fast and you could just wait a bit.<p>One common AoC trick is that you can brute-force part one (e.g. O(n^2) complexity or worse), but part two scales up `n` to make that intractable.<p>*ignore my sloppy conflating of concurrency and parallelism
I agree with you. I don't think either concurrency or parallelism have ever been necessary. In 2019 with Intcode, it was the <i>simplest</i> approach (use multiple threads, one per VM) for a couple days, but it was never actually necessary. You could do the same thing with purely sequential code, but you had to juggle the state of multiple running systems yourself then. Threads were much easier (or coroutines, go routines, processes, etc.; some concurrency system).<p>And by design, every problem is solvable on decade old computers in a reasonable amount of time (seconds) so parallelism is great if you're looking to minimize the runtime, but it's never necessary.
I very much enjoy the cat and mouse game of assumptions regarding part 2, it always makes me happy when the second part is just a simple adaptation of the existing solution.
Cool, it would be nice if that one aligned the days which were on weekends, as those tend to have harder problems.
For those just glancing at the chart do note the scale is logarithmic, so the difficulty increases exponentially.
Ugh, I hate log scales used arbirarily, every silicon valley nerd things it makes them cool like their EE profs teaching actual science or Ray Kurzweil singularity whatever nonsense.
Ray Kurzweil is indeed full of crap (I have a specific bone to pick with his intentional mis-use of life expectancy among other things), but what makes you think in this case the use of log is arbitrary? Did you look at the data with a linear axis? I just tried it, and the vertical space is dominated by 4 or 5 outliers, and on top of that you can’t see the trend as well when it’s linear and all the data is smooshed at the bottom. Log plots are great when your values span many orders of magnitude. That’s true in this case, and the log plot both uses less vertical space, which is nice, and it more clearly shows the trend and wastes less empty space on the small minority of outliers.
I usually make it Monday 18 or 19 and then I loose the will as the time taken is excessive, and obsessing about it is not good. I've finished a 5 years, but all after the fact. Some I am not sure I'll ever finish....
A friend recently shared this with me. I think you'll like it.<p><a href="https://eli.li/december-adventure" rel="nofollow">https://eli.li/december-adventure</a>
All things in moderation! Now if I can just make it through the winter without installing the new Factorio DLC...
this comment actually prompted me to finally download and install the factorio demo, been hearing so many things about how it takes over lives! :)
It really is such a great game! I got the base game, beat it a few times, then my partner and I played a few mods, currently in an Angels+Bobs playthrough. So much replay value
So, you <i>want</i> it to take over your life?
I've been playing half an hour each morning before the rest of the family wakes up. Just finally made it to the volcano world
I will probably solve the first 7 puzzles like every year and then just stop.
I got stuck on the graph-cut puzzle for FOUR MONTHS. I had to write a force-directed graphing engine to find the longest three edges to cut.<p>After I solved it I looked at other people's solutions and they used Meta's proposition solver in about 10 lines. Seemed like a massive cheat to me.
Oh man, this is my best memory of last year's AoC. After uselessly noodling for a while, I used Graphviz to draw the graph to an SVG file. It drew two messy balls of yarn neatly connected by three edges.<p>My script still says "TODO: find a real solution". Good times.
I have a self-imposed goal of not using third-party libraries for any of the solve logic. It feels more satisfying to do it myself, even if it takes longer.
Like Minecraft, everybody should play it however they want, it's just a game.<p>Which one was the "graph-cut puzzle" ? I've had a few where I couldn't do them on the day, either I was busy or I found them harder than usual or sometimes both.<p>It looks like in 2023 I took until almost New Year's Eve to finish, but until like the 21st of December I was fine, I got thrown off by travel and other commitments in the last few days as they got more difficult.
What solver are you referring to? I've used z3 and OR-tools, but I find it so difficult to model problems in either one that I seldom get good usage of either one.
We run a private board for Advent of Code for the Carolina Code Conference. Eligibility for prizes starts after earning only 10 of 50 possible stars precisely for this reason.
Oh cool. I live in WNC and had just missed your last conference in August. Is it possible to join multiple private boards? I usually do one with my coworkers as well
Yep. I’m running a little behind but the announcement will come out later today on our site/email list.<p><a href="https://carolina.codes" rel="nofollow">https://carolina.codes</a>
You can only “own” one board, but you can join many.
That's awesome. We do the exact same thing for prize eligibility on my work leaderboard. The whole point is for it to be fun and challenging. No need to grind to the end unless you want to.
I just have them lingering in the back of my brain the whole year. I solved the last one from last year a month ago. This is much nicer than sudokus or whatever: I sometimes dream about them and I keep finding better (in my mind) solutions for ones from years ago. It's lovely when you sit at another dumb crap meeting/standup so you have something to do in your head.
Likewise. I did it one year in college and it became a life-consuming thing almost immediately. Not AoC's fault - part of it was depression, part of it was the Minnesota winter. Now that I have a full-time job and a wife, I'm trying to be more careful with those things that I know will suck me in.
> I can really enjoy the winter break from work<p>What line of work are you in that you can take a winter break, and furthermore, that you can actually not work during that break? I'm envious...<p>I've always wanted to do AoC but on top of work it is too much.
I get the week between Christmas and New Year's off and then I take a bunch of my PTO in December. It's not an official break or anything.
Lots of people (in tech at least) take time on top of mandatory vacation that can result in like 2 weeks of time.
Ah yeah I've been there! Having done it a few years now, I've found that the approach that works for me is: if it starts looking like I'll be stuck on one for more than a few hours, I'll skip it and move on. Otherwise I'll accumulate an insurmountable backlog that becomes more of a depressing chore to think about, than a fun little christmas tradition. I'd rather have a <i>mostly-complete</i> set of problems by the end of the year that I can come back and clean up when I feel like it.<p>That said, if you'd have a better holiday season by just stepping back from the computer and relaxing then that sounds great too. Either way - enjoy!
My main complaint the last time I did this (2022) was the havoc it wreaked on my sleep schedule. Advent of Code is not kind to East Coast participants.<p>Every year except for one has been kind of the same pattern for me:<p>Day 1: this year, I'm just going to solve the problems. No futzing around.<p>Day 3: but it would be kind of neat to turn the solutions into a reusable AoC library. Just something minimal.<p>Day 5: and I should really add a CLI harness for retrieving the problems and parsing the input files.<p>Day 6: and testing of course.<p>Day 7: maybe I'll skip today's problem (just for today) and keep improving the framework.<p>Day 358: oh neat, Advent of Code is coming up.
I'm in CET so time-wise it can be ok - problems open at 6am meaning if I get up I have about an hour around before I need to walk my walk my dog and get ready for work. But switching on at that time is really hard, the amount of stupid off-by-one errors, or referring to since-renamed-but-still-present functions in my Jupyter Notebook is not even funny.<p>But I luckily managed to avoid the "reusable AoC library" problem around 2019 when a week beforehand I wrote down the sort of functions I wanted to have at my disposal (usually things around representing 2D/3D grids of unknown size and pathfinding/debugging therein, but a few other bits and pieces) and made a simple library that I will sometimes add things to after I'm done with the problem for the day.<p>I was tempted to some functions (similar to those your CLI harness provided) for retrieving test data and submitting answers but I managed to stop myself short of that! But I am sure you're far from the only one to end up down that road.
I'm in CET too, and 6:00 is not an hour where I’m awake, and if I were, my brain functions would definitely not be at a level where I would be capable of coding.<p>Midnight would be much more acceptable.
What if you don't get up?
If it's a work day and I don't wake up on time, I'll pick away at it over the course of the day - usually I'll get a chance to think about it on my tram ride to work and complete it at lunchtime<p>If it's a weekend I'll just do it at my leisure at some point during the day when I have some time - maybe head to a nice cafe or something.<p>I'm nowhere near the top 100 - closest has been iirc top 200 a few years back - so it's not like I <i>need</i> to start at 6am.
Stay out of my head!
One reason I didn't enjoy it was that I felt the days don't build on each other well. So you get little code reuse. It was continually changing requirements, so it was especially like work.
In 2019 he built up about 12 challenges using a VM, for Intcode, you had to construct. It was poorly received because without a working version (developed over the first few Intcode challenges), you couldn't solve the rest of them. He hasn't done anything like that since, though I thought it was probably the more interesting series of challenges.<p>The problem with continuity across days is that the later days can be blocked by the earlier ones, as they were in 2019. That partly defeats the purpose (or structure) of the challenge, where you can mostly pick any day and try it without regard to earlier days or prior years.
I agree that it wasn't completely well-received, and I think this is a real shame. The stated goal of Advent of Code was always to make better programmers. Extending, maintaining, and testing large systems is an important part of real-world engineering efforts.<p>I thought the IntCode thing was great and I hope to see something like that again this year.
I agree. Intcode was fun, but completely destroyed the promise of skipping a day and still having fun with later puzzles. I didn't come to enjoy it until much later.
People are skipping days? I usually drop out when I'm stuck on some day. 2019 was my favorite.
Most years I've skipped a couple days and revisit them later. Usually just because I give myself 1-2 hours limit to avoid staying up too late working on them, and unless it's the weekend I don't always have time during the next day to wrap them up. No reason to stop just because of a single blocker.
There's a lot of potential code reuse between years; whether that's good or bad is up to you, I think. (I would personally prefer if my Chinese remainder theorem solving function got <i>less</i> use, but it seems to be called for every year or two.)
Heh, I just checked. That's where I got stuck last year, too. I solved the first half.
Hahaha...I love this comment. I have just been stuck for a week doing edge puzzles and backstepping recursion, keeping myself awake aye night because it bothered me I couldn't "just" solve it.
The year I did it I got lucky and solved them all within a reasonable amount of time until there was one that suddenly involved a lot of nontrivial linear algebra and I immediately spotted that this wouldn't be fun and noped out. Noticed the number of people solving dropped off a cliff on that day.<p>I think as nerds we need to be quite careful not to get too drawn into this kind of thing. Sometimes it's like a superpower, but other times it just pointlessly consumes your life. Kinda makes me think of gambling addiction: "when the fun stops, you stop".
You can also set a time rule. For me it's 45min, if it takes longer to solve it, I an allowed to quit.<p>It's totally worth it, though, especially for the first week, when you look up how other people solved the thing you just solved. I always learned (or re-learned) something from that. IMHO there's not that much value in looking up solutions before you solved it yourself, though.
I will try to do it with F# and Gleam this year, but like every year I won’t have time (and brain) to do more than 10/12 days ^^<p>For the pythonists around here, give F# a try: it can feels very close to scripting and it has a wonderful REPL too :)
I'm continuing my tradition of doing AoC in Whitespace[0]. The first year I did it, it was motivation to build out a standard library so things wouldn't be so tedious. Now, I find myself wishing I had finished better tooling. I debug with wsjq[1], a CLI debugger like gdb written in jq, but it's slow.<p>[0]: <a href="https://github.com/thaliaarchi/ws-challenges">https://github.com/thaliaarchi/ws-challenges</a><p>[1]: <a href="https://github.com/thaliaarchi/wsjq">https://github.com/thaliaarchi/wsjq</a>
I've done last two AoCs in F# (well, only the first few days too). For a person without prior functional programming experience, it was fun! Unfortunately I won't have time to participate this year, but if I did, I'd probably chose F# again.
I am doing it in bash. Will see how far I can go!
How's linux support? :)
Perfect, run loads of f# and c# on Linux, and have for years
Works like a charm for me with Ubuntu 24.04/VSCode/Ionide (F# extension) !<p>For AoC I don't use a real project setup, just a `dayX.fsx` file and I run it like a script with `dotnet fsi dayX.fsx`, et voilà :)
If almost 9 years were not enough to make this question seem silly, perhaps DuckDuckGo/Kagi/Perplexity could answer this?
People here are doing it in Common Lisp and C standard library, meanwhile I’m just sitting here trying to get a curl call to download the data file.
Copy your session token into .token then:<p>curl "<a href="https://adventofcode.com/2024/day/$DAY/input" rel="nofollow">https://adventofcode.com/2024/day/$DAY/input</a>" --header "Cookie: $(cat .token)" > input.txt
You could open the dev console in the browser and copy the curl command off the network tab
Assuming you already opened it in a web browser, why not right click the page and choose "Save As"?
I just copy and paste into a local text file, but I bet there’s a tool if you want to do it programmatically already (unless curl’ing is your idea of fun!)
I have this script:<p><pre><code> #!/bin/sh
set -e
curl "https://adventofcode.com/${YEAR:?}/day/${DAY:?}/input" --cookie "session=$(cat .token)"
</code></pre>
then: YEAR=2024 DAY=1 ./aocdata
The command line tool included with this python library does just what you want once you paste your session token into an environment variable:<p><a href="https://github.com/wimglenn/advent-of-code-data">https://github.com/wimglenn/advent-of-code-data</a>
You can use Firefox: "Copy as cUrl" (<a href="https://superuser.com/a/1382425" rel="nofollow">https://superuser.com/a/1382425</a>)
Solved the whole thing. It's a business problem. Just replace the Chief Historian.
Woohoo, one of the highlights of this time of year. I had to do mine from an eastbound flight over the pacific. This has become a fun tradition not just for me personally but for many friends, colleagues, and fellow HNers. Big props once again to wastl and his helper elves for making this!<p>I encourage anyone who gets value from this to donate to support it if they can. It is a passion project but nonetheless comes with real costs.
> I encourage anyone who gets value from this to donate to support it if they can. It is a passion project but nonetheless comes with real costs.<p>With the sheer amount of sponsors and AoC++ users I do believe that this is not quite a small 'passion project' struggling to pay the monthly subscription to a VPS.<p>That being said, adventofcode is absolutely great and people should support it if they can. But I do think the author is doing quite well with the amount of support he is currently receiving.
I still haven't made my way through all of the 2015 problems yet. But I don't play the game correctly any way: instead of trying to solve the problems as fast as I can, I try to write well-documented easily maintained code which runs fast. Balancing 'easily maintained' and 'runs fast' takes a little more time than 'just solve it' _and_ I'm planning on working my way through the problems chronologically, so I doubt I'll get to the 2024 problems any time this decade.
> But I don't play the game correctly any way: instead of trying to solve the problems as fast as I can, ...<p>FYI trying to solve the problems as fast as you can is not considered "the correct way". The author has emphasized multiple times that going for the leaderboard is not for everyone and requires a pretty questionable coding style. The main goal is to have fun and learn something new.
That’s one of the many ways to do Advent of Code.
I try to do everything in a single pure functional expression no matter how dumb and unreadable that makes the code look.
[flagged]
Why not?<p>It’s supposed to be fun. As long as you’re not cheating the global leader board - which this approach doesn’t - why not play however you want.<p>I like go to overboard writing parsers for each day.
From the about page: "... However, you should do Advent of Code in a way that is useful to you, and so it is completely fine to choose an approach that meets your goals and ignore the leaderboard entirely."
Is there really a <i>wrong way</i> to do it?
Yes, with ChatGPT or similar: " Can I use AI to get on the global leaderboard? Please don't use AI / LLMs (like GPT) to automatically solve a day's puzzles until that day's global leaderboards are full."<p><a href="https://adventofcode.com/about" rel="nofollow">https://adventofcode.com/about</a>
Ha! Yeah, imagine me streaming my working on AoC, basically anyone tuning in the stream would say 'you're doing it wrong, stop having fun!' and leave.
my guess is that the creator would almost certainly disagree with you
Other challenges (in advent and not in advent) like advent of code:<p><a href="https://github.com/NoelJacob/advent-and-other-calandars">https://github.com/NoelJacob/advent-and-other-calandars</a>
Compiled by myself.
Do you want to add Genuary to your list? A month of daily prompts to get you producing some generative / creative coding art. Starts Jan 1. Website here: <a href="https://genuary.art/" rel="nofollow">https://genuary.art/</a><p>I've promised myself that one year I will move beyond the first seven prompts ... who knew creativity could be so taxing?
Hey! Thank you. I have updated mine to include the ones from your list.<p><a href="https://github.com/vimode/Advent-Calendars-For-Developers">https://github.com/vimode/Advent-Calendars-For-Developers</a>
Not a challenge, but it may be of interest anyway - Sergey Tihon's F# Advent Calendar: <a href="https://sergeytihon.com/2024/10/26/f-advent-calendar-in-english-2024/" rel="nofollow">https://sergeytihon.com/2024/10/26/f-advent-calendar-in-engl...</a><p>I think there's a few of these for different languages/tech. I think they may be good for HN'ers seeking some kind of little daily advent-y fix without the potential emotional/mental investment of AoC.
This is great, thanks! I usually do AoC to learn a new programming language but there's no more language I care to learn right now.
Going to use it to learn a bit of Ada. I've always been curious about it. It's not a popular language, and it has some serious documentation problems. Sure, there are guides for "hello, world" and other basics, but how to use a generic integer vector or even how to read lines with two numbers from stdin or a file? That was a bit of a puzzle. I saw a solution that allocates an array of 99999 elements, just to track the number of occurrences of each number in the input.<p>Ada took me somewhere between 90-120 minutes, whereas I had the first problem done in JavaScript in about 30s-60s, just for verification.
<i>Ada.Integer_Text_IO</i> with <i>Get</i> will happily read across all whitespace, including new lines, to find the next integer. This is true for most (all?) instances of <i>Get</i>, though that may not always be what you want.<p><pre><code> with Ada.Integer_Text_IO;
use Ada.Integer_Text_IO;
procedure main is
Left : Integer;
Right : Integer;
begin
Get(Left);
Get(Right);
Put(Left);
Put(Right);
end main;
</code></pre>
If you give it any of these pairs it'll work as expected, put it in a loop and you'll get all of them:<p><pre><code> 1 2
3 4
5
6
</code></pre>
Sometimes thinking about lines is a red herring in AoC, the lines often don't matter, only getting each value into the appropriate collection (a pair of vectors in this case since you don't know the size). For the counts, you can use a hashed map, they're built into the standard library. If you learn to use them now that'll help you out in later days, they're a commonly used collection (for me) in these challenges.
I know that now, even though some of the details remain fuzzy (Get_Line reads 100 characters?), but it's just that the documentation is a big pile of facts with very little to guide you towards the right function/type. And then to get it to use in the rest of the code. And of course, many 'modern' helpers are simply not available, so that too takes a bit of time to find out. But that's learning.
It stops at 100 or the length of the supplied string or the end of the line, whichever is shorter. You can also use unbounded strings which allows you to skip specifying the size for the output.<p><pre><code> with Ada.Strings.Unbounded.Text_IO;
use Ada.Strings.Unbounded.Text_IO;
with Ada.Strings.Unbounded;
use Ada.Strings.Unbounded;
procedure main is
Line: Unbounded_String;
begin
Line := Get_Line;
Put_Line(Line);
end main;
</code></pre>
<a href="https://learn.adacore.com" rel="nofollow">https://learn.adacore.com</a> - good source of tutorials, unfortunately a lot of the better learning materials beyond this are books, not online tutorials.
Am I alone in thinking that measuring time to get answer is the worst possible metric? I have not participated because of that (yet).<p>If there is a community for those who use other rules to compare actual solutions instead of answers I would be interested to hear about it.<p>I am coming from low level C++ gamedev side so I understand that most people here use different tools to solve different problems.
The vast majority of people are doing it for fun or learning purposes and not to compete on the leaderboard, and it wouldn't quite be fair to compare much else in a competitive setting but time of completion and correctness, since you'd be at a disadvantage just by language choice in many other metrics. Unless you are someone with experience competing in competitive programming you almost certainly won't make the leaderboard anyway.<p>If your goal is to compare solutions, lots of that happens on the subreddit for it where people post solutions in their language of choice on the daily threads.<p>I just do it for fun. When I was younger I'd actually do them at release (11pm in my timezone), now I don't even bother and just used them as sort of a brain teaser to start my days and compare with coworkers who also do it, a lot of us in different languages.
I try to get it done within a day, so they don't back up, but I've never tried to compete. I am PST which opens at 9PM. I try to get through part 1 then, so I can sleep on part 2.<p>The subreddit /r/adventofcode contains discussions of solutions with lots of different skill levels.<p>I've done AoC for five years to learn new languages and try solve all of them myself during the month of December. (Dunno if I'll run the whole thing this year - I have another project.) Others try to get on the leaderboard, and some will implement solutions that they've seen sketched on reddit.<p>Last year a few people used Z3 for one of the problems, and I went back and tried that to get some experience with Z3. And I've occasionally gone back and tried another approach or new trick that I saw on the subreddit. (In the years that I've used Lean, I've sometimes gone back and added proofs for termination or array indices, too.)
I think most people don't participate for the competition. I did it several times to increase my coding skills, have fun or get more practice in a new programming language.
Can you propose other metrics that don't involve executing stuff in a whole lot of languages? The point is to let people work in whatever they want, as only the solution matters. If only the solution matters I don't really see other options beyond time.
> If there is a community for those who use other rules to compare actual solutions instead of answers I would be interested to hear about it.<p>Generally you have the main community on reddit (memes, questions, daily thread for sharing solutions), then the language specific subreddits or hosted forums where you will see solutions discussed and shared, plus a couple of new users asking questions.<p>Also, within the daily main community thread you will see the niche sub community of people posting their code-golfing attempts.
Here's a website that appears to be about competing on the performance of each solution: <a href="https://codspeed.io/advent" rel="nofollow">https://codspeed.io/advent</a>
I also don't like it, last year we had a private leaderboard at work and I realized being crazy enough to wake up at 5:50 every and solve at least part 1 would give me an edge. But the "wake up at 5:50" part is what I enjoyed the least.<p>However, there are other ways to rank yourself against others. You can order your private leaderboard by number of stars, or make your own leaderboard using their APIs.
That's like saying you don't want to go for a run, because professional marathon runners are so focused on time
It could be interesting to find the shortest solution. But the site is not set up for verifying solutions in various languages.
I wouldn’t use an AI to solve the problems, but I wonder if an AI could give good feedback on a solution I cook up?
I can hear the elves calling me...<p>But no, last year I lost all momentum on my side projects and my gf thought she'd lost me to the elves.<p>Completing it on time was rewarding but I can't go back.<p>But I can hear those elven bells a jingling...
I completed last year's in Scryer Prolog and it was a joy. Some problems were almost impossible due to the lack of mutation (Karger's algorithm comes to mind), but file parsing was a breeze and I find Prolog programs generally beautiful. My favourite syntactical feature is the full stop at the end of clauses.
Erlang lifted it as the comma, semicolon, dot convention. When I was writing a lot of Erlang I found myself wishing it was in other languages. After not writing Erlang for a long time, I wrote a few functions recently and it was jarring. Then again I usually prefer the conventions of whatever language I'm using most at the time, unless I really dislike the language (Javascript).
Woohoo! This is my favorite time of the year. As the year rolls into vacation'ish days and on call rotations, this is where I hunker down and use this to code something other than power point. Last year, solved via my primary language (Java), then ported to Rust. This year, I'm starting with Rust. I had not realized it was the first.
I've never done AoC but I've done other programming-related challenges before. I come from a non-IT background (mech eng), and I'm currently away for work for the first several days with only their locked-down laptop.<p>Normally I'd break out Python for this, but given the constraints maybe I should try to see how far I can get through this in Excel. It'd be a fun little challenge :)
My approach here would be to make an index.html file with a script tag and drag it onto whatever browser is available. Then again I have made peace with JavaScript!<p>(I think you could even use typescript with this method with the on the fly babel transpiler (you just include a script tag) but I haven't tried that.)
I use Excel for the first few as well! I actually find it to be easier than using Python/Javascript, at least early on.
The tiny thin gray font on black background is impossible to read on a mobile device :(
Color aside they also ignore a number of solutions for font resizing that follow the users accessibility settings. I can think of at least three easy ways to do this with html/css alone, and yet hear we are; a site that is unreadable to me.<p>I love what Advent of Code does, but when your site is all text, there's just no excuse to not let the user resize it by default.
AoC day one challenge… make website responsive
It is terrible for me on my desktop too :(
On iOS you can switch to Reader view, and I imagine Android has something similar.
I tried that, but it broke all navigation links (including to the actual exercises).
Yes on Android it's already readable in Firefox, but that may be due to ad-blocking plugin. Even so, Firefox reader mode makes it even better.
*browser not os feature :)
if you want to use Zig, here are some tips : <a href="https://kristoff.it/blog/advent-of-code-zig/" rel="nofollow">https://kristoff.it/blog/advent-of-code-zig/</a>
My personal challenge last year was to solve everything on my mobile phone, using LLMs (mostly ChatGPT4 with code interpreter; I didn't paste in the problems, but rather described the code I wanted.)<p>This year I'm declaring "Advent of Claude"!<p>Challenge: Write a Claude custom style to solve Advent of Code puzzles within Claude's UI.<p>Score: # adventofcode.com stars earned in 2 daily conversation turns.<p>Fine print: web app artifacts are allowed, including paste of your custom input into the artifact UI; one click only.<p>Per <a href="https://adventofcode.com/2024/about" rel="nofollow">https://adventofcode.com/2024/about</a>, wait until the daily <a href="http://adventofcode.com" rel="nofollow">http://adventofcode.com</a> leaderboard is full before submitting LLM-generated solutions!<p>Of course, feel free to use ChatGPT custom instructions, static prompts, etc.<p>Day 1: two stars, <a href="https://claude.site/artifacts/d16e6bdb-f697-45fe-930c-7f58b2b5bb16" rel="nofollow">https://claude.site/artifacts/d16e6bdb-f697-45fe-930c-7f58b2...</a>
I believe that this page should be mobile friendly. I won't be coding on mobile, but reading about it on my portable device would be great.
I'm gonna try doing this on the NES (Nintendo Entertainment System) this year.<p>Probably some problems will be impossible with limited RAM (2KiB, plus an optional 8KiB on the cartridge, maybe more if a fancy cartridge is used). But I'll try to solve as many as possible.<p>Today's was possible, in under 4 seconds, using 4KiB extra RAM on the cartridge.
what is the dev cycle like on that? can you attach to it and operate it remotely via something like a repl or do you have to compile something to a cartridge and boot it from that?
Very interested in this - I have a SNES flash cart, I wonder if there's a good basic library to handle printing to the screen and such.
If LLMs are really as good at writing code as some people say, they should write a script that fetches each challenge, as soon as it's released, and feeds it to an LLM, to produce a solution. Then run this code and submit the answer it outputs.
I’m attempting to make my own language for solving the puzzles as I go along.
I'd pretty much decided I wasn't going to participate because it would take up too much time, but now you've both made it way more complicated and way more appealing...
I did this, and it's been very satisfying! Here's where I'm at now: <a href="https://www.youtube.com/watch?v=r99-nzGDapg" rel="nofollow">https://www.youtube.com/watch?v=r99-nzGDapg</a>
This is the first time I've seen Firefox's alternate stylesheets mentioned in the wild. Interesting.
Lots of people seem to be doing hardcore things like using C without libraries, limiting memory etc.<p>And here I am doing it in Ruby instead of Java this year thinking I was giving myself a challenge.
I’m using sqlite this year. Hoping that there won’t be any computational geometry or trie problems. Kind of hoping for a graph problem solvable with recursive CTEs, that would be cool.
I've been doing a lot with SQL for the first time in my life, this is tempting. I posted some SQLite CTE dark magic the other day but I certainly didn't understand it.<p>Edit: Someone else posted an "Advent of " list which included <a href="https://adventofsql.com/" rel="nofollow">https://adventofsql.com/</a>, perhaps those problems will be a little more pedestrian for SQL.
I've solved some days in past years with sqlite + enough awk to transform the input into something that can be imported into a table. It can be a fun challenge.
This is the first year that I will do AoC. I have never wanted to, but I have a working language of my own now.<p><a href="https://gavinhoward.com/2024/11/advent-of-code-2024-getting-started/" rel="nofollow">https://gavinhoward.com/2024/11/advent-of-code-2024-getting-...</a>
I would love it if the first star of the day was required, but the second was a bonus. I love Advent of Code, but I don't have the time to get 50 stars.
No stars are required at all. You can also skip some days if you don't want to do them. Or only to the first stars. However you like. First/silver stars will also increase your score in the leader boards.
Same. Especially when it gets really hard later on. Despite studying CS, I still struggle with it.
I usually get stuck about halfway through and give up.<p>Doing it in a Lisp I’ve been writing in Ruby will have me giving up even sooner, but it will be fun!
I love looking at AoC solution megathreads on reddit. So many languages and so many different approaches are hard to find and observe anywhere.
I feel like those threads would make great research opportunities. We often hear people say that code should be for people to read, incidentally for machines to execute, just be amazed at how much the readability varies from answer to answer.<p>Skimming some, the core of Part 1 after people have parsed and sorted:<p>Python:<p><pre><code> sum([abs(x-y) for x,y in zip(left,right))
</code></pre>
TypeScript:<p><pre><code> list1.reduce((acc, cur, i) => {
return acc += Math.abs(cur - list2[i])
}, 0)
</code></pre>
Common Lisp:<p><pre><code> (reduce #'+ (mapcar (lambda (l r) (abs (- l r))) sorted-left sorted-right))))
</code></pre>
Julia:<p><pre><code> sum(abs.(list1 .- list2))
</code></pre>
Rust:<p><pre><code> Ok(zip(left, right).map(|(l, r)| l.abs_diff(r)).sum()
</code></pre>
F#:<p><pre><code> Seq.map2 (fun x y -> abs (x - y)) xs ys |> Seq.sum
</code></pre>
APL:<p><pre><code> +/|-⌿
</code></pre>
Haskell:<p><pre><code> map abs $ zipWith (-) column2 column1
</code></pre>
and then all the submissions which don't do anything like this, and have manual loops and indexing and clunky data representations or performance-optimized data representations, etc. etc.
> You don't need a computer science background to participate - just a little programming knowledge and some problem solving skills will get you pretty far.<p>The use of “pretty far” gives them a bit of an out, but I think this statement is a little disingenuous. Last year, at least, a bunch of the problems needed fairly sophisticated algorithms to find the solution in a reasonable amount of time.<p>To me, a little programming knowledge is what somebody who is six weeks into their introduction to programming class has. They know variables, loops, lists, and maybe associative arrays.
"Participate" doesn't mean "win". You can look things up as well. I haven't done a ton of AoC, but the harder ones from it I've seen were not very hard to search/research for the correct algorithm (even avoiding "what's the answer for day X" searches).
AoC doesn't require any particular algorithmic knowledge to solve its problems. Sometimes knowing algorithms is useful to quickly write your solution, but IME it's never a requirement. Unlike leetcode-style challenges, AoC tasks usually don't even try to punish you for solutions that are specific to your particular input. You can get some stars with just pen and paper.<p>It's more like a set of logic puzzles. Programming and algorithms are only incidental.
Anecdote to support your comment: The Chinese Remainder Theorem has featured in Advent of Code at least twice IIRC. Not an algorithm the average programmer (average is a very fuzzy term, yeah) would know.
> The Chinese Remainder Theorem has featured in Advent of Code at least twice IIRC<p>Fortunately it's never been needed. Every time it's come up the problem has been solvable with high school algebra level math skills (you need to know what the lcm is and that's covered in middle school in many places). If you knew the CRT you could jump straight to a solution, but a solution was easily derived using algebra and a couple loops.
I'm excited about this! I'll be sticking to Python so I can practice writing maintainable code. I'm also looking forward to keeping up with my explanations of each puzzle, which helps me (and others!) learn a lot.<p>Everything is here: <a href="https://advent-of-code.xavd.id/" rel="nofollow">https://advent-of-code.xavd.id/</a><p>I'm unlikely to finish it all in December (the puzzles get hard and I get busy) but I _do_ love the event.
For anyone interested in using this to learn Elixir or improve your skills with it, I saw this video[0] a while back and their AoC starter repo[1] is super slick.<p>[0] <a href="https://www.youtube.com/watch?v=gpaV4bgEG-g" rel="nofollow">https://www.youtube.com/watch?v=gpaV4bgEG-g</a><p>[1] <a href="https://github.com/ChristianAlexander/advent-generator">https://github.com/ChristianAlexander/advent-generator</a>
There are a few Elixir solutions fo Day 1 here, including mine: <a href="https://elixirforum.com/t/advent-of-code-2024-day-1/67786" rel="nofollow">https://elixirforum.com/t/advent-of-code-2024-day-1/67786</a>. I'm using it as a motivator for actually learning the language/libs.
This has been a good driver for me to add features to <a href="https://rcl-lang.org/" rel="nofollow">https://rcl-lang.org/</a>. I just added List.sort for today’s problem.
Interesting, do you publish your AoC solutions in rcl somewhere?<p>EDIT: nevermind, found it!
<a href="https://github.com/ruuda/adventofcode/tree/master">https://github.com/ruuda/adventofcode/tree/master</a>
I love AoC. I made a CLI client in python for me (and a lib for common tasks, especially the 2d grid maps).<p>Repo: <a href="https://github.com/ArcHound/advent_of_code">https://github.com/ArcHound/advent_of_code</a>
Writeup: <a href="https://blog.miloslavhomer.cz/p/advent-of-code-cli-client-and-library" rel="nofollow">https://blog.miloslavhomer.cz/p/advent-of-code-cli-client-an...</a><p>Good luck to y'all in 2024 and enjoy!
Excited to try this. I was aiming to be done by Christmas, but this is my first AoC and reading other replies makes this seem a bit unrealistic. Decided to do it in elisp to try and improve my emacs-fu and lisp knowledge.
This year I will solve AoC using Gleam. My challenge is to finally learn functional programming and learn Gleam at the same time.<p>I already solved the first problem and it was hard to get things ready, read the file, handle the data, etc. But once I had the first steps done it was easy to solve the problem
Not sure if it would take away from the experience, but there's this repo which is made for AoC that handles getting the input from a text file, sets up a source file for each day, etc<p><a href="https://github.com/TanklesXL/gladvent">https://github.com/TanklesXL/gladvent</a>
Remarkable. Bought, sold within 2 weeks. Really underwhelmed
It feels like AI will shape a lot of the submissions for these types of coding “traditions”. But, I guess that’s just the world we live in.
I'm actually pleasantly surprised by the results. I like to think that despite problem 1 being easily solvable by LLMs, just about everyone (sans qianxyz) read the FAQ, and decided that they would forego a leaderboard spot for the sake of this coding tradition.<p>Either that, or there were hundreds of people trying and none were able to get it working despite the basic problem. I like to imagine most people reading the rules and being a good sport.
Even before AI I was never fast enough for a respectable global rank, but it's still fun to compare solutions with friends.
The global leaderboard is so fast that any AI assistance would literally slow them down, here's one of the guys who tends to score highly solving today's puzzle. (<a href="https://youtu.be/ym1ae-vBy6g" rel="nofollow">https://youtu.be/ym1ae-vBy6g</a>), and on the more complicated days that's even more pronounced because anyone who is even somewhat decent doesn't need to ask chatgpt how to write Dijkstra.<p>Obviously if you're doing it recreationally you can cheat with AI but then again that's no different than copying a solution from reddit and you're only fooling yourself. I don't see it having an impact.
The "winner" solved it in 9 seconds using AI so I don't understand how you can claim that.<p><a href="https://adventofcode.com/2024/leaderboard/day/1" rel="nofollow">https://adventofcode.com/2024/leaderboard/day/1</a>
Python looks excruciatingly slow to me. If you want fast I believe you need to think and write in vector languages like kdb+/q. I am not a kdb+ expert by any means and my code can probably use more q primitives, but here was my solution in ~2 minutes:<p><pre><code> i1:("I I";" ")0: `:1.txt;
sum {abs last deltas x }each flip asc each i1 / answer 1
sum {x * sum x = i1[1]}each i1[0] / answer 2</code></pre>
Everything autocompletes in Python.<p><pre><code> from collections import *
xys = list(map(int, open(0).read().split()))
xs = xys[::2]
ys = xys[1::2]
xs.sort()
ys.sort()
print(sum(abs(x-y) for x,y in zip(xs,ys)))
yc = Counter(ys)
print(sum(((yc[x])*x for x in xs)))</code></pre>
this is the least amount of loc I can think of rn<p><pre><code> data = { i+1 : sorted([ x for x in list(map(int, open('input').read().split()))[i::2]]) for i in range(2) }
total_distance = sum(list(map(lambda x: abs(x[0]-x[1]), zip(data[1], data[2]))))
print("part 1:", total_distance)
similarity_score = sum(list(map(lambda x: (x*data[2].count(x))*data[1].count(x), set(data[1]).intersection(data[2]))))
print("part 2:", similarity_score)</code></pre>
That’s cool, but horribly ugly! What does production kdb+ look like? Is it similarly terse, maybe Perl-ish, or was this purely for speed?<p>What does each flip asc do?
The thing is that the AI can read a puzzle faster than a human can. If someone put any effort towards an AI-based setup, it would easily beat human competitiors (well, up until the point the puzzles got too difficult for it to solve).
All the people I know already participate on private boards. AI enshitification will only speed up the process of moving there.
It also doesn't make any sense for most of the people to compete with the geniuses on the public leader board. It's like signing up for the Olympics as an amateur athlete.
Are we using enshittification for everything we don't like these days? We invented calculators, those really enshittified manual arithmetic puzzles.
Private boards for this stuff makes sense anyway, it's the Internet afterall.
Using LLM for this kind of thing is like using cheats or aim assist for online games. So yes, this is prime example of enshifittication.
enshittification isn't "things become worse" - it's the specific process of how services worsen in 3 stages:<p>> Here is how platforms die: first, they are good to their users; then they abuse their users to make things better for their business customers; finally, they abuse those business customers to claw back all the value for themselves. Then, they die. I call this enshittification, and it is a seemingly inevitable consequence arising from the combination of the ease of changing how a platform allocates value, combined with the nature of a "two-sided market", where a platform sits between buyers and sellers, hold each hostage to the other, raking off an ever-larger share of the value that passes between them.
I think the intent is important. Using LLMs to do well on the public leaderboard is like using cheats/aim assist. But learning how to use LLMs to solve complex puzzles independent of any sense of "competition" is more like when people train neural networks to drive a car in GTA or something - it's not hurting anyone and it can be a real learning experience that leads to other interesting byproducts.<p>But, yeah, don't use LLMs to try and get 9 second solve times on the public leaderboard, it's not in the spirit of the thing and is more like taking a dictionary to a spelling bee.
Just the shitty things like using LLMs to spoil a fun competition
No, we do not. Calculators are a whole different issue from LLMs, which plagiarize and spoonfeed whole paragraphs of thought.<p>Enshittification occurs when previously good or excellent things are replaced by mediocre things that are good enough for those susceptible for advertising and group think.<p>Examples are McDonalds vs. real restaurants, Disney theme parks vs. Paris, the interior of modern cars, search engine decline, software bloat etc.
I use it to learn new languages - this year it's Ada -<p><a href="https://blog.adacore.com/announcing-advent-of-ada-2024-coding-for-a-cause" rel="nofollow">https://blog.adacore.com/announcing-advent-of-ada-2024-codin...</a>
Last year, I spent more time coming up with a reusable framework than the challenges themselves, proven by the fact that I only solved two days.<p>This year, I shook my head at my framework and rewrote it, but at least that only took me a day (so far). Day one was easy, which also helps. IIRC, last year’s first few days were non-trivial.
One of the things I look forward to. It is a lot of fun.
The first year was the best year for me. It was really fun and I think I got 22/24 days done. After that my participation rate has been shocking, I really want to do it but I get this weird anxiety that I'm not quick enough.<p>Which is weird because that is not a thought that entered my mind when I did it for the first time. It was pure fun!
I know a lot of people use AoC to try out/learn a new language. I tried that with Go in like 2018. However, I found it too frustrating (especially since AoC requires a lot of string parsing/regex which are difficult/verbose in Go).<p>The past few years I've decided to stick to the same principle I've used in all of my side projects recently. Either I do something in a new language, or I get it done correctly before I get bored. I've found I can't have both.
I am a bit late to the trend, but I am planning to do Advent of CUDA this year. It's been a while since I have written a lot of parallel code, and thinking about concurrent algorithms is fun.
I just did this in a few lines of python with numpy. I don’t understand why the input isn’t a csv.
I usually get to around day 10 in AoC before they get so time consuming that I give up. I still really enjoy the first week or so though!
This is my fourth year. I'm using Go while being surprised how inadequate it is for this kind of problem. Standard libraries lack basic data structures and often Go is too slow for a compiled language!
I can't explain why but doing AoC is always interesting, and doing LeetCode which is supposed to be similar is always very depressing.<p>Wishing everyone a fun challenge. This year I will be practicing F# and hope some of you will give it a try too :) <a href="https://github.com/neon-sunset/AOC24/blob/master/day1.fsx">https://github.com/neon-sunset/AOC24/blob/master/day1.fsx</a>
Think it's because certain topics, such as dynamic programming or graph algorithms, are just not something you can attack from first principles for most mortal people. I certainly wouldn't have invented binary trees. So there is quite a bit of things to read up on (though it should all be covered in an algorithms course).<p>Then once you do get that context... like LeetCode problems often aren't very inspiring? A lot of the time it's "just apply this technique here".<p>Whereas in AoC, at least in the first few weeks, it's mostly just, do the task, attack it from first principles.
AoC would be more stressful if you had to solve a problem in 30 minutes for a highly competitive job.
I had 3 of those 1 hour interviews for a position at Apple, with people watching every move and thinking of ways to break the solution. I don't think I could do it again, no matter what.
those exist. except I think the one I did was an hour(? it was ten years ago).
I got the interview, but that didn't go well, so I went to work elsewhere.<p>they have part of the site that has lessons for developers:<p><a href="https://app.codility.com/programmers/" rel="nofollow">https://app.codility.com/programmers/</a><p>I haven't used it for a long time, but they also have contests with some small prizes:
<a href="https://app.codility.com/programmers/challenges/" rel="nofollow">https://app.codility.com/programmers/challenges/</a>
I’m also doing them in F# (again). Hoping to best my past attempts, never gone beyond day 12 before!<p>I’m never gonna do it fast but I enjoy using fparsec to get the input text in whatever format I need each time, even if writing and debugging the parsers sometimes takes up way too much of my time!
The community is most of the difference. That and the problems aren't very similar to leetcode.
The Christmas theme is fun and it’s nice to do one problem per day with a large community.<p>With leetcode you’re off in the woods by yourself. Stuck on a problem? Here’s a cold write up. Finished a problem? Do another, monkey.
Have you ever tried the LeetCode live competitions? I found those to be really fun with a great community. Just grinding problems in isolation can definitely be depressing.
That's actually a very important question I think, and sorely neglected by most educators! (and book authors, etc)
Svelte is doing its own Advent of Code challenge with a twist this year. Instead of challenging users, the maintainers will be challenging themselves to launch one feature a day. Today's feature is error boundaries!<p><a href="https://bsky.app/profile/svelte.dev/post/3lcavobxn7c2k" rel="nofollow">https://bsky.app/profile/svelte.dev/post/3lcavobxn7c2k</a>
I don’t code for a living anymore so this looks fun.
I did some of it in TXR Lisp a bunch of years ago.<p><a href="https://www.kylheku.com/cgit/advent/tree/2021" rel="nofollow">https://www.kylheku.com/cgit/advent/tree/2021</a><p>Give it a try. The structure and recurring themes in these solutions could be used as a source of ideas for how to get started.
Because we can assume that these problems necessarily cannot be in the training set of any current LLM (and are hard enough, i.e. they should be more than mere variations on existing problems), I'm wondering if they can be a good benchmark to get a better sense of how good they really are at problem solving?
I'm trying Haskell this time.<p>For this one, I learned how to write a basic parser with Text.Parsec and manipulate the tuples with bimap !<p>It's a very fun occasion to learn a new programming language.
Yup. Advent of Code is a fun, yearly alternative to LeetCode with a Christmas theme, and it's approachable for novice developers.
Day 1 led me to a deep(ish) dive into the CPython implementation of the abs(...) builtin. Good times!
Does anyone know what is the theme of this year? If it's VM or anything low level then it's fun.
I've generally chosen a new (to me) or spartan lang to challenge myself, but this year I'm going easy mode with python and just focusing on meeting the requirement.
AoC is fun for learning a new language but I feel like all of us have that one "project" that we rewrite every few years in this language or that to learn it.
other advents are available…<p><a href="https://raku-advent.blog/2024/12/01/day-8-rendering-down-for-christmas/" rel="nofollow">https://raku-advent.blog/2024/12/01/day-8-rendering-down-for...</a><p><a href="https://news.ycombinator.com/item?id=42286954">https://news.ycombinator.com/item?id=42286954</a>
I love AoC. You don't have to care about the AI bots solving it or people waking up earlier than you, just solve it for your own fun. Either because you like the challenges, or to try it in a new language etc.<p>I like to do them in a functional style in Kotlin as far as possible, as that's different from what I do at work.<p>Edit: Here's mine from today, with my utils it's not exactly plain kotlin, but part of the fun is building a library of sorts with cool functions <a href="https://github.com/Matsemann/algorithm-problems/blob/main/adventofcode2024/src/main/kotlin/com/matsemann/adventofcode2024/Day01.kt">https://github.com/Matsemann/algorithm-problems/blob/main/ad...</a>
Nice one, i like your transpose function, as python-numpy user in past years, but kotlin this year, i really missed the transpose function the most for this day one. My code: <a href="https://github.com/charelF/AdventOfCode/blob/main/kt/src/y2024/D01.kt">https://github.com/charelF/AdventOfCode/blob/main/kt/src/y20...</a>
Unzip was nice, will remember that one!<p>This is also what I like, reading other's solutions and learning new stuff. I browse the subreddit after solving it myself to see all kinds of cool approaches.
This year I'm going to try to do this in Haskell.
I'm doing the challenges in PowerShell to see how it goes.<p>I want to use it as a test to see how human programming can be improved by an AI, so I wrote the solution for day 1, got the right answer, and then gave my code to ChatGPT 4o to ask it to make the code faster.<p>My version ran in ~3500 ms
ChatGPT's version ran in 140 ms<p>both worked<p>A great example of how a common DevOps language program can be improved on by ChatGPT.
That seems rather slow for yours, and not very fast for an optimised one. It can speed up a lot from a cold start to a warm run, my tuned code can show 8 ms in powershell 7.4 after a few runs.<p>My hack-it-out code: <a href="https://pastebin.com/PDQhxDc9" rel="nofollow">https://pastebin.com/PDQhxDc9</a><p>Faster code: <a href="https://pastebin.com/6xwaVkwq" rel="nofollow">https://pastebin.com/6xwaVkwq</a><p>The hacky code uses slower techniques like:<p>- Get-Content which adds metadata to every line.<p>- @() arrays with += which copies the array in memory to a new one-larger memory location for every addition.<p>- Pipeline overhead e.g. ForEach-Object and Measure-Object.<p>- Filtering the whole second column for each number in the first column, repeated wasted work.<p>and it's still in the region of your ChatGPT one.<p>The faster one addresses these with:<p>- ReadAllLines() .NET method to get plain strings.<p>- [system.collections.generic.list[int]]::new() which don't box integers and can grow more quickly.<p>- plain adding numbers into sum variables.<p>- Building a hashtable [system.collections.generic.dictionary[int, int]]::new() to count each number in the second column.<p>- Swapping -split for string split() which may have a tiny bit less overhead.<p>- no pipelines.<p>The code isn't completely different, it's the same blocks doing the same things, leaning more on .NET lower levels, and years of experience of the basic PowerShell performance hits.
I think I'm going to be using MicroSoft QuickBasic for System 7 this year. I might regret this pretty quickly.
I never have made it to the end of a season, just due to lack of time. It's great fun, though - already solved today's "warm up" puzzles...
While I agree that just dumping the puzzle instructions into an llm and getting the right answer at least doesn’t align with the spirit of Advent of Code (though it does show how crazy good LLMs are getting), I’m using this as an opportunity to try out the new Windsurf AI IDE and am driving the AI code editing in it to help me write the code to solve each puzzle (I’m using Ruby).<p>My goal is to develop the muscle memory for the tool so I can write code quickly. I’m still generally thinking through the puzzles, but being able to just write out plain English logic, get code generated, ask for it to be well documented, quickly refactor things to be generally reusable, etc, is just fantastic and how all software development should be done in this day and age frankly. Such an accelerator to problem solving.
Is this any good for beginners/kids?
Sure, but it starts to get hard a few days in so beginners won't be able to finish. However, I think that makes it an amazing learning opportunity. There's plenty of write-ups on solutions on the internet.
What I hate about AoC is the tons of bullshit about Christmas elves I have to tolerate before getting to the damn point. I mean, I understand they want to make the context entertaining, but sometimes it's like reading a Jira card written by a junior product owner!<p>BTW I love AoC for all else
I maintain a joke domain which I've found sadly applicable through the years. <a href="https://adventofrealizingicantread.com" rel="nofollow">https://adventofrealizingicantread.com</a>. I try to keep it updated pointing to the current day throughout the month<p>I've found especially as the month progresses it's just as much Advent of Reading Comprehension as it is coding :)
AoC is in this weird place where it's too easy to be fulfilling on its own, but too bothersome to just do it for leisure. I did it once (using Python with no imports for some mild challenge), waking up super early to actually start on time, then golfing my answers if I felt like it. It was a fun thing to do... once. I don't feel the need to repeat that and I don't find it engaging enough to do without time pressure, so I don't.<p>Perhaps if you aimed at global leaderboards it would be different, but that's neither my league nor I see any fun in that - getting there requires serious effort and preparation in things that aren't directly related to solving intelectual puzzles.
It's best for me when I do something that I ordinarily don't do for AoC.<p>I find no particular pleasure in using an everyday language like Python for it, because as you said it's too easy.<p>I have used Haskell, Racket, and in some easier cases APL and it's been fun. Treating it more like a puzzle than an actual programming assignment.<p>When learning new languages, it's best to do something that actually makes you think in a different shape. If you know Python, don't do Ruby. If you know Java, don't do C#.
It goes into "too bothersome" territory in this case for me. Competing in a local leaderboard was fun and kept me engaged until the end, but it was only possible by choosing a comfortable language to be free to actually think about the puzzle itself to solve it fast. Choosing something that I'm not already familiar with (or that isn't well-suited for this type of tasks) is a great way to ramp up the difficulty and perhaps gain some bragging rights, but I can't see me doing it for longer than a few days before losing interest. Even in this "easy mode" in Python, there were four days that had me spend more than an hour (up to 5h) on the task. There's plenty of actually useful projects I could do in this time to learn new things instead after all.
C# allows for terser and very functional-y implementations thanks to differences between LINQ and Java’s Streams.
Getting the vibe of Google code jam<p>Pretty good tbh
Getting the vibe of Google code jam, pretty good
New factorio dropped. Probably be doing that with every spare minute of the day.
I haven't completed one before and I have a question for those who have. Can I treat the entire month as one code based which evolves over time, with an evolving set of unit and integration tests? Or do some days require starting from scratch? Lots of people here are talking about completing it in exotic languages but I'm more interested in using it to sharpen enterprise coding techniques.
Every day is mostly independent of the others. I generally don't reuse code because most of the common code is easy enough to rewrite, sometimes I copy/paste earlier code in to a new solution.<p>The main exception is 2019's Intcode VM/interpreter which was used over about a dozen days (I mentioned it elsewhere, he hasn't done anything like that since). Occasionally, beyond basic algorithms there is some continuity between 2-3 days but that's not terribly common, I don't think there were any pairs of puzzles like that last year or the year before.<p>If you want to make one code base, you'll still have 25 or so separate solutions. You might have some continuity with common algorithms (like A*) that get used a fair bit in search problems or abstracting out the input handling when you identify common structures for parsing.
Here's to another year of being sleep deprived for the entire month of December.
I read the entire page and I don't see anywhere that it actually lists what the puzzles are, I'm so confused.
9 seconds to get both stars is absolutely insane - there had to be some AI assistance here.<p>Come to think of it, a pipeline that feeds the problem text into an LLM to generate a solution and automatically runs it on the input and attempts to submit the solution, doing this N times in parallel, could certainly solve the first few days' problem in 9 seconds.
I participate almost every year but I don't care about the leaderboard. The timezone play a crucial role in being able to be ready at the right time, so actually who cares?
I prefer to build private leaderboards with my friends and colleagues.
Yep, there was; they even wrote so in their commit message before removing it: <a href="https://old.reddit.com/r/adventofcode/comments/1h3w7mc/2024_day_1_no_llms_here/" rel="nofollow">https://old.reddit.com/r/adventofcode/comments/1h3w7mc/2024_...</a>
It was, of course, an AI-generated solution; they posted it here: <a href="https://web.archive.org/web/20241201052156/https://github.com/qianxyz/advent-of-code/commit/6458076f5782790f8878a957add96093e72ce5a2" rel="nofollow">https://web.archive.org/web/20241201052156/https://github.co...</a><p>Later, after being called out on it, they posted an apology to their GitHub profile (<a href="https://web.archive.org/web/20241201064816/https://github.com/qianxyz" rel="nofollow">https://web.archive.org/web/20241201064816/https://github.co...</a>): "If you are here from the AoC leaderboard, I apologize for not reading the FAQ. Won't happen again."<p>Both the repo and that message are now gone.
Caring about the leaderboards is the problem. Are you (impersonal) seriously doing AoC for clout or something?
The primary reason to not care about AoC leaderboards is that that it penalizes people for being in the wrong time zone. That said, the top 100 or so contributors clearly do care about these things and using an LLM is cheating.<p>In particular the LLM cheating isn’t just by conjuring a solution: humans don’t get ASCII characters pumped directly into their brain, we have to slowly read problem descriptions with our eyes. It takes humans more than 9 seconds to solve AoC #1 purely because of unavoidable latency.
If people are concerned about leaderboards there are private leaderboards: <a href="https://adventofcode.com/2024/leaderboard/private" rel="nofollow">https://adventofcode.com/2024/leaderboard/private</a><p>Personally I don't do it to compete, I just like puzzles.
I did it without AI last year and planning to do it again, for fun.
True. Leaderboards are and always have been full of cheaters.
For comparison, here's how long it took in past years:<p><pre><code> 2015 - 10:55
2016 - 7:01
2017 - 1:16
2018 - 1:48
2019 - 1:39
2020 - 7:11
2021 - 1:07
2022 - 0:53
2023 - 2:24
</code></pre>
And this year's second place was 0:54.
Note that regarding the outliers, in 2015 and 2016 the puzzles weren't as widely known, and in 2020, AWS' load balancers crashed and the puzzle was unavailable to most people for 6 minutes, then solved in a few minutes. <a href="https://adventofcode.com/2020/leaderboard/day/1" rel="nofollow">https://adventofcode.com/2020/leaderboard/day/1</a> -- postmortem: <a href="https://old.reddit.com/r/adventofcode/comments/k9lt09/postmortem_2_scaling_adventures/" rel="nofollow">https://old.reddit.com/r/adventofcode/comments/k9lt09/postmo...</a>
OpenAI did something similar with their o1 model. Ran a coding problem through o1 thousands or maybe millions of times and then checked if the solution was correct.<p>I can imagine a great pipeline for performance optimization:
1. have an AI generate millions of tests for your existing code
2. have another AI generate faster code that still makes the tests pass<p>So I guess all I want for Christmas is a massive compute cluster and infinite OpenAI credits :P
AI coding assistants ruined the global leaderboard experience. AoC might as well nerf it by discarding the quickest x percent of submissions, or something...
It's not that bad. I'm sure there are more LLM'ers in there than the one, but you can tell that the majority of the day 1 leaderboard is made up of people who have historically performed well, even before LLMs were a thing.<p>Compare <a href="https://adventofcode.com/2024/leaderboard/day/1" rel="nofollow">https://adventofcode.com/2024/leaderboard/day/1</a> to e.g. <a href="https://fuglede.github.io/aoc-full-leaderboard/" rel="nofollow">https://fuglede.github.io/aoc-full-leaderboard/</a><p>There was also at least one instance of people working together where you would have 15 people from the same company submit solutions at the same time, which can be a bit frustrating but again, not a huge issue.
I have a rule in life: no summary statistics without showing the distribution.<p>Usually this goes for any median which might be in a sneaky bimodal distribution of, say, AI models vs humans. I guess it applies to leaderboards too though.
Potentially the challenge just doesn’t make as much sense anymore? There apparently are „mental calculations” competitions and I’m sure their participants have fun. Yet I can hardly imagine doing arithmetic in ones head is any fun for an average mathematician. The challenge just shifted elsewhere over time.
They should check that LLMs can't solve the problems in 9 seconds and come up with appropriate problems. Or just allow AI assistants, they are now as much part of the programmer's toolkit as syntax highlighting or autocomplete or Stack Overflow, and pretending otherwise is not useful.
Not gonna happen. AoC always starts with beginner level problems. That's why it's so commonly used for learning the basics of new languages.<p>A problem that wouldn't be immediately solvable by LLMs would either be too advanced or simply too large to be fun.<p>This is probably where programming as a whole is going. Many of the things that make programming fun for me, like deeply understanding a small but non-trivial problem and finding a good solution, are gonna be performed much faster by LLMs. After all most of what we do has been done before, just in a slightly different content or a different language.<p>Either LLMs will peak out at the current level and be often useful but very error prone and not-quite-there. Or they'll get better and we'll be just checking their output and designing the general architecture.
The first few days are supposed to be beginner-accessible, it's practically impossible to have something beginner accessible but GPT-inaccessible.
And then allow aimbots for counterstrike, stockfish at chess tournaments and Epo on the tour de France.
The leader board is intended for people to compete against each other, one could make a separate leaderboard for LLM, kind of similar to the chess AI leaderboards.
> allow aimbots for counterstrike<p>I'm not played counterstrike in over a decade, so you got me wondering - are there matches where everyone uses aimbots? What does the game look like then? I suppose there's a new mix of strategies evolving, with a higher focus on the macro movement planning?
False equivalence. The sole reason for counterstrike and chess to exist is competition. Programming is about solving a problem. If you want to turn programming into a competition you shouldn't take away tools from the programmer.
That's like going out for a run and taking an electrical scooter around the park instead. The point isn't finishing, the point is doing the activity.
I wonder how many seconds could be won by the organizers if the challenge included a blant prompt injection breaking the result.
Without condoning cheating, I am impressed with the automation aspect of it. 9 seconds sounds more or less like the inference time of the LLM, so this must have been automated. Login at midnight + lots of C&P may not have done it.<p>Perhaps there is a scope for an alternative AoC type competition aimed at AI submissions...<p>...though of course that would be experimenting to get us all out of work. Hmm.
As with real life, the speed generally doesn't matter as long as you get a working solution and you find it fun. If you find "copy and paste into an LLM and then copy and paste the answer back out" fun, then I suppose you do you.<p>I didn't realise it was be timed, which is good because I casually set up a new rig to give future puzzles some kind of rig. I used C# which, although probably more wordy than other solutions, did the job and LINQ made light work of the list operations. Ended up with about 6.5 minutes for each one but most of that was refactoring out of pedantry.
At this point, it just shows that Advent of Code is completely worthless given the ease and accessibility of AI-assisted tools to solve these problems.<p>RIP Advent of Code.
I love AoC, but I hate the timing. December is always the busiest month of the year, so I really almost never find the time for it :(
Nice to see that traditions are upheld, such as the unreadable font and colors.
And the timeless tradition of HN commentators cynicism
And the timeless tradition of criticising perfectly valid concerns. Not everyone wants to be a member of the dark mode lobby.
I had to fiddle with the colours in the web inspector to even read the page. So yeah...<p>Of all the cynical comments I see on HN, this ranks very very low.
And the timeless tradition of HN commentators contempt
It's a simple webpage. If you don't like it, you can customize the CSS with a few custom rules in your browser.
Reposting a comment below: I used Stylus[1]. There are already some considerably more readable themes by the community.<p>[1]: <a href="https://github.com/openstyles/stylus">https://github.com/openstyles/stylus</a>
Personally I love the esthetic and hope they never change it.
Yeah, I made a userscript for myself to fix that up: <a href="https://gist.github.com/xPaw/4fffaf776fe14d15c9602991f51dbfa1" rel="nofollow">https://gist.github.com/xPaw/4fffaf776fe14d15c9602991f51dbfa...</a>
[flagged]
[flagged]
[flagged]
[flagged]
Is there a way to override the CSS (on Chromium)? The body font and weight, Source Code Pro is far too thin and far too wide and gives me a headache (and has regularly turned me off AoC). I'd like to change it to `sans-serif`.
Self-response: Stylus is useful here[1]. There is a list of already more readable styles than the default that the community has prepared.<p>[1]: <a href="https://github.com/openstyles/stylus">https://github.com/openstyles/stylus</a>
I have used Stylus for CSS tweaks: <a href="https://addons.mozilla.org/firefox/addon/styl-us/" rel="nofollow">https://addons.mozilla.org/firefox/addon/styl-us/</a>
You can hit the "Reader" button on Firefox (ctrl-alt-r), I think Chrome also has that? Or an extension that does the same thing would probably work.<p>Bit simpler than writing an override or fetching the HTML.
There are CLI tools to fetch and submit solutions. At least one of them allows you to download the puzzle description as markup: <a href="https://github.com/scarvalhojr/aoc-cli">https://github.com/scarvalhojr/aoc-cli</a>
On thing you can do is fetch the html and extract the main content to display it in your favorite way, it's been stable for years, and you can use the (stable) session_id cookie, it's how many people approach the challenge.
I'd just create a bookmarklet or run JS in devtools: `document.body.style.fontFamily = "sans-serif";` etc
[flagged]
Using an AI to solve AoC is like taking an art class and complaining that the still life exercises aren’t very interesting because your camera can capture the image quickly.
This is already answered right on the about page[0]. AoC is meant to be an educational experience, feeding it directly into a LLM isn't that.<p>> The leaderboards are for human competitors; if you want to compare the speed of your AI solver with others, please do so elsewhere. (If you want to use AI to help you solve puzzles, I can't really stop you, but I feel like it's harder to get better at programming if you ask an AI to do the programming for you.)<p>[0] <a href="https://adventofcode.com/2024/about" rel="nofollow">https://adventofcode.com/2024/about</a>
Work on a side project this December instead of doing this. Solving advent of code just keeps you in your comfort zone. Creates a false sense of accomplishment. Redirect all the positive energy to something that will make you proud when you are old or help with an earlier retirement. This won't.
Advent of Code is fun, I like having fun! I have no shortage of challenges and things to be proud of, but when I’m old I don’t want to look back and realize I didn’t take the time to find little moments of joy along the way.<p>Everyone’s different, and it sounds like AoC isn’t for you, but remember not everyone is you :)
I used it to spend time in Haskell. You won’t win any prizes for speed, but it’s a good way to learn a bunch of new stuff.
That's fair. Just sending the message out to folks who are in similiar space and might do a reconsideration.
> Redirect all the positive energy to something that will make you proud when you are old or help with an earlier retirement. This won't.<p>So if some activity [work] doesn't contribute to your ability to never have to work again [retirement], you shouldn't do it?<p>What if I've retired, am I allowed to do AOC then? Or then does the first rule of, only do something the future you would be proud of apply?<p>What if all of the things I'm proud of are just a false sense of accomplishments? How do I know when I'm actually allowed to be proud of it, or if it's just a false sense of pride?
Or use it to practice a language that you just wanted to give a spin.
Yet you're on HN instead of working on your sideproject.
Learn to let go of the constant need to be productive.
I’m gonna do a side project because it’s more fun and useful to me.
> help with an earlier retirement.<p>Like car accident?