Live data from Hacker News

Advent of Code 2024

adventofcode.com

331–340 of 580 posts

Re: Advent of Code 2024

#331
post #327

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 can really enjoy the winter break from work 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... I've always wanted to do AoC but on top of work it is too much.

Lots of people (in tech at least) take time on top of mandatory vacation that can result in like 2 weeks of time.

Re: Advent of Code 2024

#332
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 betw…

I decided to do it in Erlang in 2019, that Intcode VM was much "fun"... I really enjoyed it, I wish there were more years than that.

Re: Advent of Code 2024

#333

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 ^^ For the pythonists around here, give F# a try: it can feels very close to scripting and it has a wonderful REPL too :)

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.

Re: Advent of Code 2024

#334

Earlier quoted context omitted.

Modern LLMs are very good at solving programming puzzles like that. As soon as it recognizes which algorithm needs to apply, it's just massaging the data to the right format.

Your answer somehow suggests that solving such problems is merely "recognizing which algorithms to apply".. which is another way of saying that they are more "pattern matchers" than "true reasoners". I would think, on the contrary, that these problems (at least the tougher ones that are coming in about two weeks) require more than pattern matching, but I'm not sure exactly what are my thoughts on that.

Consider ignoring the reasoning for how/why LLM's can do this sort of thing which doesn't matter as much when you simply try it out. I wouldn't be surprised if many of these problems are in fact solved by LLM's. Just from my experience using them to solve relatively novel issues in my day-to-day. There will of course be mistakes and hallucinations, but in a proper dialogue with a motivated programmer, I bet it works >50% of the time.

Re: Advent of Code 2024

#335

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.

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 just do the puzzles until it stops being fun. For me that's usually around day 14.

Re: Advent of Code 2024

#336

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.

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.

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.

Re: Advent of Code 2024

#338

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

Your restrictions sound quite challenging, good luck! Last year I solved all the problems in C without external 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!). [1] https://github.com/sebastianotronto/aoc/tree/master/2023

Fitting, given that iirc one of the problems was to implement a hashtable!

Re: Advent of Code 2024

#339
post #159

I usually do AoC in Common Lisp, but this year I'm giving Swift a chance. It's not half bad at this kind of twiddling for being a statically typed mainstream language. https://github.com/codr7/aoc24/tree/main/swift/Sources/aoc 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 stitch…

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.

Re: Advent of Code 2024

#340

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.

Assuming you already opened it in a web browser, why not right click the page and choose "Save As"?
Post reply on HN