Live data from Hacker News

Advent of Code 2024

adventofcode.com

261–270 of 580 posts

Re: Advent of Code 2024

#261

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.

What's so hard about Day 12? It's just +/'{x:".",x;H:(-1+;1+i-)@'+|\m*i:!#m:x=\:"#." R:(x=x)({[h;d;x;y;z](z#0),+\(((-z)_~"#"=x)&z_d>z)*(*y),(-z+1)_y-0^y h}. H)[x]/y (*|R)-R@*|0,&1_*+m}.''1({("?"/:5#,x;,/5#,y)}.')\@[;1;.:]'" "\:'0:`:i/12.txt

Is this Q? or k?

Re: Advent of Code 2024

#262

Because we can assume that these problems necessarily cannot be in the training set of any current LLM (and are hard enough, i.e. they should be more than mere variations on existing problems), I'm wondering if they can be a good benchmark to get a better sense of how good they really are at problem solving?

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.

Re: Advent of Code 2024

#263
post #146

Earlier quoted context omitted.

The global leaderboard is so fast that any AI assistance would literally slow them down, here's one of the guys who tends to score highly solving today's puzzle. ( https://youtu.be/ym1ae-vBy6g ), and on the more complicated days that's even more pronounced because anyone who is even somewhat decent doesn't need to ask chatgpt how to write Dijkstra. Obviously if you're doing it recreationally you can cheat with AI but…

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?

Re: Advent of Code 2024

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

I find it useful for trying new languages. The first 10 days usually start very easily and progress quite gradually. The 2nd half definitely gets more brutal, but if you do have the self-control, you can stop whenever it stops being productive.

I love it for these meta-type use cases that aren’t necessarily about solving the puzzles.

For instance I’m using it this year to dial in new neovim configs. Last year was to get comfortable with a split keyboard.

Re: Advent of Code 2024

#265

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.

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

Generally you have the main community on reddit (memes, questions, daily thread for sharing solutions), then the language specific subreddits or hosted forums where you will see solutions discussed and shared, plus a couple of new users asking questions.

Also, within the daily main community thread you will see the niche sub community of people posting their code-golfing attempts.

Re: Advent of Code 2024

#266

Earlier quoted context omitted.

What's so hard about Day 12? It's just +/'{x:".",x;H:(-1+;1+i-)@'+|\m*i:!#m:x=\:"#." R:(x=x)({[h;d;x;y;z](z#0),+\(((-z)_~"#"=x)&z_d>z)*(*y),(-z+1)_y-0^y h}. H)[x]/y (*|R)-R@*|0,&1_*+m}.''1({("?"/:5#,x;,/5#,y)}.')\@[;1;.:]'" "\:'0:`:i/12.txt

Is this Q? or k?

Looks like K to me!

Re: Advent of Code 2024

#267

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.

Yet you're on HN instead of working on your sideproject.

Re: Advent of Code 2024

#268

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.

The year I did it I got lucky and solved them all within a reasonable amount of time until there was one that suddenly involved a lot of nontrivial linear algebra and I immediately spotted that this wouldn't be fun and noped out. Noticed the number of people solving dropped off a cliff on that day.

I think as nerds we need to be quite careful not to get too drawn into this kind of thing. Sometimes it's like a superpower, but other times it just pointlessly consumes your life. Kinda makes me think of gambling addiction: "when the fun stops, you stop".

Re: Advent of Code 2024

#269

Earlier quoted context omitted.

What's so hard about Day 12? It's just +/'{x:".",x;H:(-1+;1+i-)@'+|\m*i:!#m:x=\:"#." R:(x=x)({[h;d;x;y;z](z#0),+\(((-z)_~"#"=x)&z_d>z)*(*y),(-z+1)_y-0^y h}. H)[x]/y (*|R)-R@*|0,&1_*+m}.''1({("?"/:5#,x;,/5#,y)}.')\@[;1;.:]'" "\:'0:`:i/12.txt

Is this Q? or k?

It's k4, the underlying language behind Q. With slight modifications it also runs in ngn/k which is FOSS.

https://ngn.codeberg.page/k/#eJxVjsFugzAMhu95iiyWik1CIGPtIVG...

Re: Advent of Code 2024

#270
post #215

Earlier quoted context omitted.

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

Post reply on HN