Live data from Hacker News

Advent of Code 2024

adventofcode.com

291–300 of 580 posts

Re: Advent of Code 2024

#291
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).

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.

Re: Advent of Code 2024

#292

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,…

It's best for me when I do something that I ordinarily don't do for AoC.

I find no particular pleasure in using an everyday language like Python for it, because as you said it's too easy.

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.

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#.

Re: Advent of Code 2024

#293
post #285

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.

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.

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.

Re: Advent of Code 2024

#294
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).

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.

Re: Advent of Code 2024

#295
post #208

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.

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.

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 less use, but it seems to be called for every year or two.)

Re: Advent of Code 2024

#296

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.

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. 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.

My script still says "TODO: find a real solution". Good times.

Re: Advent of Code 2024

#299

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. 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...

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. https://git.sr.ht/~q3cpma/aoc2024/tree/master/item/01 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.

Re: Advent of Code 2024

#300

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. 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...

Do you have a public repo?
Post reply on HN