Tristan Brindle

Tristan Brindle

@tristanbrindle.com

229 followers103 following46 posts

Update: after seeing Python folks using regex to solve today's #AdventOfCode I thought I'd give it ago in C++, and... wow. Still brute force, but now it's beautiful! 😍

Tristan Brindle@tristanbrindle.com

I might have overdone the sequence chaining while brute-forcing #AdventOfCode day 2, but I have no regrets github.com/tcbrindle/ad...

I've just posted a long old update about my plans for the Flux library, focusing on ease of use, performance and a potential future standardisation effort. I'm keen to get feedback at this stage so please head on over to Github and leave a comment if you so choose... github.com/tcbrindle/fl...

github.comThe Road to Flux 1.0 Β· tcbrindle flux Β· Discussion #242Flux has been around for a couple of years now, and the feedback I get is mostly that people seem to think it's pretty good. I think it's pretty good too! But I'm also aware that the current design...

I'm a bit of an AI skeptic, but I thought I'd give Copilot a go in VSCode since it's now free. After writing some documentation in Markdown format, I asked it to check for any spelling or grammar mistakes. It insisted, repeatedly, that I had misspelled words *that didn't even appear in the document*

This is ChatGPT 4-o, which has been trained on tens of millions of books and articles on every subject under the sun at eye-watering cost. Yet apparently it can't even correctly analyse a few hundred words of english text. And this is supposed to be the future?

I've found the last few days pretty tricky, so #AdventOfCode day 18 was a nice change of pace. Dijkstra's algorithm came up a couple of days ago so I had an implementation ready to go, and then std::partition_point() does all the hard work for part 2. I like this one!

A frustratingly vague #AdventOfCode day 14, where we're asked to "find a picture of a Christmas tree" with no absolutely no further details. I solved it by the ingenious method of dumping 10,000 ASCII "pictures" to a text file and searching for "*********". I'm not proud! At least part 1 was easy.

Day 5 of #AdventOfCode felt kinda like cheating once I realised that the rules give us an ordering that we can use as a comparator with sort()/is_sorted(). Using a hash set gives about a 10x speedup versus a sorted vector + binary search, but the latter is plenty fast enough for the problem size

One super helpful trick I discovered from AoCs past is to use a grid type whose operator[] returns an invalid character (e.g. '.') when given an out-of-bounds position -- it saves tons of messy bounds checking elsewhere.

I forgot to mention, the full code is on Github if you want to take a look: github.com/tcbrindle/ad...

github.comGitHub - tcbrindle/advent_of_code_2024: Advent of Code 2024 solutions using C++23Advent of Code 2024 solutions using C++23. Contribute to tcbrindle/advent_of_code_2024 development by creating an account on GitHub.
Tristan Brindle@tristanbrindle.com

#AdventOfCode day 3 part 1 was super easy thanks to @hanicka.net's amazing CTRE library. And part 2 is pretty lovely using Flux, if I do say so myself...

You are up to date.