Live data from Hacker News

Advent of Code 2024

adventofcode.com

181–190 of 580 posts

Re: Advent of Code 2024

#181
post #169

Earlier quoted context omitted.

>Participants have 36 hours Looks like it is for young people who have dedicated time for it everyday. Personally I would like to do anything like this with no time limit and probably no monetary prizes. I think the only value of those puzzles is to fire up rarely used neurons that hopefully are still there after another year of shipping corporate products xD. I might appreciate fresh point of view from young people…

Because only young people can make time for things. There are plenty of professionals with jobs and families making time for AOC because they enjoy it. Doing the problems at the same time as everyone else is a VERY different experience from doing them whenever you'd like. If you don't want to make the time for it, power to you. I'd recommend most people to drop off after the first 10ish days. But don't delude yoursel…

> Doing the problems at the same time as everyone else is a VERY different experience from doing them whenever you'd like.

I agree and I happen to think the experience of doing it later than everybody else is significantly better. If I search for “AoC 2024 day 12 hint”, I’ll get better results on Jan 12 than Dec 12.

Re: Advent of Code 2024

#182
post #112

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

Ada.Integer_Text_IO with Get will happily read across all whitespace, including new lines, to find the next integer. This is true for most (all?) instances of Get, though that may not always be what you want.

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

  1 2
  3      4
  5
       6
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.

Re: Advent of Code 2024

#183
post #176

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

[flagged]

Re: Advent of Code 2024

#184
post #169

Earlier quoted context omitted.

Because only young people can make time for things. There are plenty of professionals with jobs and families making time for AOC because they enjoy it. Doing the problems at the same time as everyone else is a VERY different experience from doing them whenever you'd like. If you don't want to make the time for it, power to you. I'd recommend most people to drop off after the first 10ish days. But don't delude yoursel…

I appreciate your perspective and it is correct. I should have phrased it differently. Imho: I worked with code that has long history for my entire career. If the goal is to look at some objective quality of solution then I do not believe in time limits. The longer I work the more things getting patches/updates/remasters and value of better code goes up and value of arriving at any kind of solution overnight goes dow…

For software that's meant to be maintained for long periods, especially by others, I agree with you.

The thing about AOC is that it's really less about the code that you generate, and more about the process of solving the problem. The challenge is really what you make of it. Some people will golf it, some will go for speed, other for performance, etc.

That's why it's so different to solve the problems in "real time". There's a huge community of people solving the same problem that you can interact with and bounce ideas off of. Even just a few days after the problem is released, most of that active discussion has dried up, so you can no longer participate in that discourse.

So, again, I don't think there's anything wrong at all with what you're saying, but there are other elements to consider beyond maintainable code and pristine solutions.

Re: Advent of Code 2024

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

Re: Advent of Code 2024

#186

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

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

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.

Re: Advent of Code 2024

#187

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.

Re: Advent of Code 2024

#188
post #92

Earlier quoted context omitted.

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 mostly-complete set of problems by the end of t…

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. Every year except for one has been kind of the same pattern for me: Day 1: this year, I'm just going to solve the problems. No futzing around. Day 3: but it would be kind of neat to turn the solutions into a reusable AoC library. Just something minimal. Day 5: and I s…

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.

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.

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.

Re: Advent of Code 2024

#189
post #164

Earlier quoted context omitted.

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

Re: Advent of Code 2024

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