I 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…
Advent of Code 2024
351–360 of 580 posts
Re: Advent of Code 2024
#352Ah here it is again, 25 days of writing increasingly complex input parsers.
Re: Advent of Code 2024
#353Last 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 superpo…
It's totally worth it, though, especially for the first week, when you look up how other people solved the thing you just solved. I always learned (or re-learned) something from that. IMHO there's not that much value in looking up solutions before you solved it yourself, though.
Re: Advent of Code 2024
#354Ah here it is again, 25 days of writing increasingly complex input parsers.
Re: Advent of Code 2024
#355Earlier quoted context omitted.
For what it's worth, I hate leetcode with a burning passion, have no real interest in math, and yet I personally find Advent of Code quite fun and enjoyable.
I have found AoC fun, but on some of the later days time constraints make it a little stressful (full time job + kids constrain my time). I've done it (and completed it) the last five years. I used it to try out a few languages (Haskell, Idris, Lean) and did it in python one year I was feeling lazy. I've got a project going now, and I probably should do that instead. However, that project is a programming language, s…
Re: Advent of Code 2024
#356Re: Advent of Code 2024
#357I 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'…
> But I don't play the game correctly any way: instead of trying to solve the problems as fast as I can, ... 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
#358Re: Advent of Code 2024
#359Going 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 a…
Re: Advent of Code 2024
#360Earlier quoted context omitted.
I think most people don't participate for the competition. I did it several times to increase my coding skills, have fun or get more practice in a new programming language.
It is normal for coding to seek feedback from others to your solution. Even if it is automated. Looking at 'competing' solutions after you spent time on yours can teach how others think. Improving code after you learned new facts is huge part of coding fun at least for me. People mentioned private leaderboards in the topic few times. I just don't think time to submit an answer is relevant.