Live data from Hacker News

Advent of Code 2024

adventofcode.com

311–320 of 580 posts

Re: Advent of Code 2024

#311

> 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. 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. To me, a little progr…

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.

It's more like a set of logic puzzles. Programming and algorithms are only incidental.

Re: Advent of Code 2024

#312
post #90

Earlier quoted context omitted.

Sounds sensible. It's important to set boundaries, and enjoy time off. 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. https://aoc.xhyrom.dev/ 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!

Either the problems are getting easier each year, or perhaps there are just more people participating which drives down the 100th-place times.

Re: Advent of Code 2024

#313

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. [0] https://www.youtube.com/watch?v=gpaV4bgEG-g [1] https://github.com/ChristianAlexander/advent-generator

There are a few Elixir solutions fo Day 1 here, including mine: https://elixirforum.com/t/advent-of-code-2024-day-1/67786 . I'm using it as a motivator for actually learning the language/libs.

Awesome, in that thread I found this library[0] to make it easy to write AoC solutions with Elixir's Livebook.

[0] https://hexdocs.pm/kino_aoc/KinoAOC.html

Re: Advent of Code 2024

#314

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

Re: Advent of Code 2024

#315

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

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

Heh. Yeah, a memfault tanking the machine is not conducive to iterative programming :o)

Re: Advent of Code 2024

#316

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

Glorious!

I think I'll follow in your footsteps. STM32F7 with 320k but with bare metal Rust :)

Re: Advent of Code 2024

#317
post #141

Earlier quoted context omitted.

Cool, it would be nice if that one aligned the days which were on weekends, as those tend to have harder problems.

If I understand correctly, and I'm not sure if that graph proves that, they try to put longer puzzles on weekends.

Right, Eric Wastl addresses exactly this in his talk. He considers weekends and burnout in the pacing of the event. I think this is the right video: https://youtu.be/bS9882S0ZHs

Re: Advent of Code 2024

#318

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 will probably solve the first 7 puzzles like every year and then just stop.

This is my experience. After the first week I develop an intense hatred of all things Elf and start swearing at my laptop. At which point I give up to stop my mental health deteriorating any further.

Re: Advent of Code 2024

#319

Earlier quoted context omitted.

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.

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.

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 =)

Re: Advent of Code 2024

#320

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.

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.
Post reply on HN