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…
Advent of Code 2024
521–530 of 580 posts
Re: Advent of Code 2024
#522Re: Advent of Code 2024
#523I 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.
Re: Advent of Code 2024
#524Earlier quoted context omitted.
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.
I program everyday in Swift. I attempted AoC for the first time in Swift last year and gave up after about a week or so for this exact reason and switched to python for the remainder. I don't want to struggle with the awkward string API to do things other languages can do in a line.
Re: Advent of Code 2024
#525I 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.
It’s Foundation so hopefully also on Linux/Windows, but if not there’s also one on GitHub called SwiftScanner.
1: https://developer.apple.com/documentation/foundation/scanner
Re: Advent of Code 2024
#526This 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...
Re: Advent of Code 2024
#527Last 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.
Re: Advent of Code 2024
#528Re: Advent of Code 2024
#529Earlier quoted context omitted.
I thought the Amiga 1k had page protection, just not virtual memory?
No, there's no MMU.
Re: Advent of Code 2024
#530Earlier quoted context omitted.
How do you structure your aoc project? I tried doing Rust, but I'm too dumb to figure out if each day should be a module or if I should use lib (I guess?) files for each day and link everything to a main entry point. Can you share your repo (if public)?
Take a look at my repo - http://github.com/nindalf/advent-2024 Each day is a new module, this way I don't have to think of new names for part1() and part2(). I can still import code from the rest of the crate if I want with `use crate::`. If you like this style of structuring the project, you may be interested in the generator I use for it - http://github.com/nindalf/aocgen . `aocgen --day 2` will create these files…
Though you shouldn't upload the text and inputs of the puzzles (maybe .gitignore them) as per [0]:
> Can I copy/redistribute part of Advent of Code? Please don't. Advent of Code is free to use, not free to copy. If you're posting a code repository somewhere, please don't include parts of Advent of Code like the puzzle text or your inputs. If you're making a website, please don't make it look like Advent of Code or name it something similar.