Live data from Hacker News

Advent of Code 2024

adventofcode.com

301–310 of 580 posts

Re: Advent of Code 2024

#301

Other challenges (in advent and not in advent) like advent of code: https://github.com/NoelJacob/advent-and-other-calandars Compiled by myself.

This is great, thanks! I usually do AoC to learn a new programming language but there's no more language I care to learn right now.

Re: Advent of Code 2024

#302

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

It's best for me when I do something that I ordinarily don't do for AoC. I find no particular pleasure in using an everyday language like Python for it, because as you said it's too easy. I have used Haskell, Racket, and in some easier cases APL and it's been fun. Treating it more like a puzzle than an actual programming assignment. When learning new languages, it's best to do something that actually makes you think…

It goes into "too bothersome" territory in this case for me. Competing in a local leaderboard was fun and kept me engaged until the end, but it was only possible by choosing a comfortable language to be free to actually think about the puzzle itself to solve it fast. Choosing something that I'm not already familiar with (or that isn't well-suited for this type of tasks) is a great way to ramp up the difficulty and perhaps gain some bragging rights, but I can't see me doing it for longer than a few days before losing interest. Even in this "easy mode" in Python, there were four days that had me spend more than an hour (up to 5h) on the task. There's plenty of actually useful projects I could do in this time to learn new things instead after all.

Re: Advent of Code 2024

#303
Excited to try this. I was aiming to be done by Christmas, but this is my first AoC and reading other replies makes this seem a bit unrealistic. Decided to do it in elisp to try and improve my emacs-fu and lisp knowledge.

Re: Advent of Code 2024

#304

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.

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

Perhaps it’s a reference to the Kraftwerk song?

https://www.musixmatch.com/lyrics/Kraftwerk/Boing-Boom-Tscha...

Re: Advent of Code 2024

#305

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

this is like trying to solve it in a computer built in turing complete

Re: Advent of Code 2024

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

Everything autocompletes in Python.

    from collections import *
    xys = list(map(int, open(0).read().split()))
    xs = xys[::2]
    ys = xys[1::2]
    xs.sort()
    ys.sort()
    print(sum(abs(x-y) for x,y in zip(xs,ys)))
    
    yc = Counter(ys)
    
    print(sum(((yc[x])*x for x in xs)))

Re: Advent of Code 2024

#308

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

Any idea how close that is to valid J code?

Re: Advent of Code 2024

#309

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.

I have a self-imposed goal of not using third-party libraries for any of the solve logic. It feels more satisfying to do it myself, even if it takes longer.

Re: Advent of Code 2024

#310
post #153

Earlier quoted context omitted.

Here's a website that appears to be about competing on the performance of each solution: https://codspeed.io/advent

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

Then you may like https://highload.fun/ No time limits, no monetary prizes, fastest solutions win.
Post reply on HN