Live data from Hacker News

Advent of Code 2024

adventofcode.com

421–430 of 580 posts

Re: Advent of Code 2024

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

The don't do it. Thanks for the update though

Re: Advent of Code 2024

#422

This is my fourth year. I'm using Go while being surprised how inadequate it is for this kind of problem. Standard libraries lack basic data structures and often Go is too slow for a compiled language!

I'm doing it in K2 this year (a language that has a single data structure: a vector). If you can do it in K2, you can do it in Go.

Re: Advent of Code 2024

#423

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

I'm doing this year in K2 (after a long hiatus from K). Is there a K4/5 binary? ATW gave me a K2 binary, but I miss some of the K4 and later functionality):

https://github.com/jnordwick/aok2024

Re: Advent of Code 2024

#424
Last year, I spent more time coming up with a reusable framework than the challenges themselves, proven by the fact that I only solved two days.

This year, I shook my head at my framework and rewrote it, but at least that only took me a day (so far). Day one was easy, which also helps. IIRC, last year’s first few days were non-trivial.

Re: Advent of Code 2024

#426

I'm gonna try doing this on the NES (Nintendo Entertainment System) this year. Probably some problems will be impossible with limited RAM (2KiB, plus an optional 8KiB on the cartridge, maybe more if a fancy cartridge is used). But I'll try to solve as many as possible. Today's was possible, in under 4 seconds, using 4KiB extra RAM on the cartridge.

what is the dev cycle like on that? can you attach to it and operate it remotely via something like a repl or do you have to compile something to a cartridge and boot it from that?

Generally you compile to a rom and load it into an emulator. There's a certain amount of memory manipulation you can do in NES debuggers, but it's usually just easier to go through a full build cycle; especially for small programs like used in AoC.

Re: Advent of Code 2024

#427

I love AoC! Did it the last 2-3 years in Rust, hanging out in a discord where we all try to make the absolute fastest solutions. Learnt all kinds of crazy performance hacks and some advanced algorithms & SIMD that way. This time I'm trying to do them in Rust and Golang in an effort to either learn to like/tolerate Golang (because we use it at work) or prove my hypothesis that it sucks and never use it unless I have t…

Go (not "Golang") has better compilation times than Rust and does not try to combine incompatible ways of using concurrency. I have the opposite dilemma to you, I want to learn to like Rust.

Let's try to settle the Go/Rust debate in this AoC sub-thread ^_^

Re: Advent of Code 2024

#428

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

I'm doing this year in K2 (after a long hiatus from K). Is there a K4/5 binary? ATW gave me a K2 binary, but I miss some of the K4 and later functionality): https://github.com/jnordwick/aok2024

I don't know if there's a specific k4 binary but you can run k4 through the q binary.

Re: Advent of Code 2024

#429

Earlier quoted context omitted.

Interested by your rust speed approaches, care to share a link ?

Same. I am doing rust + clojure this year. Very interested in performance hax, esp around SIMD. I know absolutely nothing at all about rust, this is my first time working with it. My day 1 rust solution: cargo solve 1 -- release Finished `release` profile [optimized] target(s) in 0.05s Running `target/release/01` Part 1: 1189304 (95.8µs) Part 2: 24349736 (120.4µs) Day 1 clojure solution: lein run 1 running all tasks…

There's a Rust solution posted in the Reddit Day 1 answers mega thread which claims 22 microseconds part 1 and 10 microseconds part 2. (I haven't tried to verify):

https://old.reddit.com/r/adventofcode/comments/1h3vp6n/2024_...

Re: Advent of Code 2024

#430
My personal challenge last year was to solve everything on my mobile phone, using LLMs (mostly ChatGPT4 with code interpreter; I didn't paste in the problems, but rather described the code I wanted.)

This year I'm declaring "Advent of Claude"!

Challenge: Write a Claude custom style to solve Advent of Code puzzles within Claude's UI.

Score: # adventofcode.com stars earned in 2 daily conversation turns.

Fine print: web app artifacts are allowed, including paste of your custom input into the artifact UI; one click only.

Per https://adventofcode.com/2024/about, wait until the daily http://adventofcode.com leaderboard is full before submitting LLM-generated solutions!

Of course, feel free to use ChatGPT custom instructions, static prompts, etc.

Day 1: two stars, https://claude.site/artifacts/d16e6bdb-f697-45fe-930c-7f58b2...

Post reply on HN