Advent of Code 2024
341–350 of 580 posts
Re: Advent of Code 2024
#342I usually do AoC in Common Lisp, but this year I'm giving Swift a chance. It's not half bad at this kind of twiddling for being a statically typed mainstream language. https://github.com/codr7/aoc24/tree/main/swift/Sources/aoc This year is a tiny bit weird, I was just getting ramped up organizing the event at a new job; because I think it's very useful for devs to learn some real problem solving, as opposed to stitch…
dont you find all the string parsing and manipulation to be quite painful in Swift? I tried to do AoC in Swift before and that put me off a lot. I liked doing little functional one liners but a week from now the parsing burden will be too high.
The language has been moving pretty fast though, I have a feeling a lot of features I find useful are relatively new.
Re: Advent of Code 2024
#343I 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'…
FYI trying to solve the problems as fast as you can is not considered "the correct way". The author has emphasized multiple times that going for the leaderboard is not for everyone and requires a pretty questionable coding style. The main goal is to have fun and learn something new.
Re: Advent of Code 2024
#344Earlier 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…
Re: Advent of Code 2024
#345I usually do AoC in Common Lisp, but this year I'm giving Swift a chance. It's not half bad at this kind of twiddling for being a statically typed mainstream language. https://github.com/codr7/aoc24/tree/main/swift/Sources/aoc This year is a tiny bit weird, I was just getting ramped up organizing the event at a new job; because I think it's very useful for devs to learn some real problem solving, as opposed to stitch…
Re: Advent of Code 2024
#346This 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...
I remember one of my naive brute force solutions from last year ended up allocating gigabtyes of memory. There were obviously more efficient solutions, but some of the inputs are pretty large and so hefty allocations might be difficult to avoid.
Re: Advent of Code 2024
#347Re: Advent of Code 2024
#348Re: Advent of Code 2024
#349I can't explain why but doing AoC is always interesting, and doing LeetCode which is supposed to be similar is always very depressing. Wishing everyone a fun challenge. This year I will be practicing F# and hope some of you will give it a try too :) https://github.com/neon-sunset/AOC24/blob/master/day1.fsx
Then once you do get that context... like LeetCode problems often aren't very inspiring? A lot of the time it's "just apply this technique here".
Whereas in AoC, at least in the first few weeks, it's mostly just, do the task, attack it from first principles.
Re: Advent of Code 2024
#350This 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...