Live data from Hacker News

Advent of Code 2024

adventofcode.com

281–290 of 580 posts

Re: Advent of Code 2024

#281

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.

Re: Advent of Code 2024

#282

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.

Re: Advent of Code 2024

#283

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.

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

Re: Advent of Code 2024

#284

Earlier quoted context omitted.

Sure those can answer it. That person is perhaps trying to be social on a social network by inviting comments instead?

This specific question posed in this specific way usually implies a negative interaction. I have seen maybe one exception here so far. And after providing detailed answers for so many times, I don't think it's worth it.

You guaranteed it would be a negative interaction when you negatively interacted with the post. You're allowed to skip the ones you don't want to reply to.

Re: Advent of Code 2024

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

Re: Advent of Code 2024

#287

Am I alone in thinking that measuring time to get answer is the worst possible metric? I have not participated because of that (yet). 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. I am coming from low level C++ gamedev side so I understand that most people here use different tools to solve different problems.

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.

The subreddit /r/adventofcode contains discussions of solutions with lots of different skill levels.

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.

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

Re: Advent of Code 2024

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

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.

Re: Advent of Code 2024

#289
post #215

Earlier quoted context omitted.

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

How about something creative that is at the same time relaxing? 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). I think by now I could even start working on my own game but I don't yet have a desire to.

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?

Re: Advent of Code 2024

#290
post #146

Earlier quoted context omitted.

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

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? What does each flip asc do?

i1 is Nx2. asc each i1 sorts each N in ascending order. flip transposes to 2xN.
Post reply on HN