#advent-of-code

Articles tagged #advent-of-code, newest first. All tags

Day 18 (Advent of Code 2022) This time around, we’re porting a solution from C++ to Rust and seeing how it feels, how it performs, and what we can learn about both languages by doing that. See Day 17 for the rationale re:… 8 min Day 17 (Advent of Code 2022) Advent of Code gets harder and harder, and I’m not getting any smarter. Or any more free time. So, in order to close out this series anyway, I’m going to try and port other people’s solutions from… 11 min Day 16 (Advent of Code 2022) Let’s tackle the day 16 puzzle! Parsing. The input looks like this: Valve AA has flow rate=0; tunnels lead to valves DD, II, BB. Valve BB has flow rate=13; tunnels lead to valves CC, AA. Valve CC has… 14 min Day 15 (Advent of Code 2022) The day 15 puzzle falls into the “math puzzle” territory more than “let’s learn something new about Rust”, but since several folks asked if I was going to continue… let’s continue. The sample input… 7 min Day 14 (Advent of Code 2022) I like how the day 14 puzzle sounds, because I think it’ll give me an opportunity to show off yet another way to have Rust embedded in a web page. But first… Let me guess: parsing? You bet your furry… 9 min Day 13 (Advent of Code 2022) The day 13 puzzle needs a speech therapist. ??? …because it has an awful lisp!! Ahhhahahahhhh. Are you ok? What is.. what is going on with you? No but seriously we have what are ostensibly… 4 min Day 12 (Advent of Code 2022) Alright! The day 12 puzzle involves path finding, and it seems like a good time to lean more heavily on the WASM embeds I’ve set up for the previous parts. Let’s start by setting up the types we’ll… 8 min Day 11 (Advent of Code 2022) It’s a new day, it’s a new advent of code puzzle. In that one, we have to apparently cosplay as an IBM mainframe and just.. crunch them numbers. This doesn’t look fun, and I can’t think of a clever… 8 min Day 10 (Advent of Code 2022) Onwards! To the day 10 puzzle. I don’t see a way to make part 1 especially fun — so let’s just get to it. Parsing. As usual, let’s reach for the nom crate… $ cargo add nom@7. (cut) …to parse the… 8 min Day 9 (Advent of Code 2022) The Advent of Code is not a sprint: it’s a marathon: sometimes you’ve got to stop and smell the roses. I… what? That’s not.. have you done a marathon before? No, and I haven’t taken any creative… 10 min Day 8 (Advent of Code 2022) In the day 8 problem, our input is a height map: 30373. 25512. 65332. 33549. 35390. This is a 5x5 grid, and every number denotes the height of a tree. For part 1, we must find out how many trees are… 8 min Day 7 (Advent of Code 2022) The day 7 challenge talks about trees! File trees that is. The temptation to solve it before starting to write this article so I don’t look silly is high, but I’m explicitly not doing so, so that we… 16 min Day 6 (Advent of Code 2022) Today I am joining you from the relative discomfort of my living room (since my better half has commandeered the home office due to Way Too Many Calls) to tackle the day 6 challenge, which I’m… 8 min Day 5 (Advent of Code 2022) Part 1. The day 5 challenge actually looks fun! Our input looks like this: [D]. [N] [C]. [Z] [M] [P]. 1 2 3. move 1 from 2 to 1. move 3 from 1 to 3. move 2 from 2 to 1. move 1 from 1 to 2. Which… 18 min Day 4 (Advent of Code 2022) Part 1. Let’s tackle the day 4 challenge! In this one, we get an input like this: 2-4,6-8. 2-3,4-5. 5-7,7-9. 2-8,3-7. 6-6,4-6. 2-6,4-8. Each line has two ranges: the first line has ranges containing… 4 min Day 3 (Advent of Code 2022) Part 1. I’m not sure where the day 3 challenge is going, because the problem statement for the first part is kinda convoluted. As usual we have an input, like this: vJrwpWtwJgWrhcsFMMfFFhFp.… 10 min Day 2 (Advent of Code 2022) Part 1. In the day 2 challenge, we’re playing Rock Papers Scissors. We’re given a strategy guide like so: A Y. B X. C Z. Left column is “their move”: A means Rock, B means Paper, C means Scissors.… 9 min Day 1 (Advent of Code 2022) Two years ago, I did part of Advent of Code 2020 using the Rust language. It was a lot of fun, so let’s try it again! The problem statement. Our input looks something like this: 1000. 2000. 3000.… 32 min Advent of Code 2022 Let’s use the Advent of Code 2022, a series of programming challenges of increasing difficulty, to learn more about the Rust programming language. 3 h 12 min Day 14 (Advent of Code 2020) It’s time for the Day 14 problem! After the hassle that was Day 13, I hope this time we’ll have a relatively chill time. And, at least for Part 1, that is true. Our input looks something like this:… 12 min Day 13 (Advent of Code 2020) In the Day 13 problem, we’re trying to take the bus. Our input looks like this: 939. 7,13,x,x,59,x,31,19. The first line indicates the earliest minute we can leave from the bus terminal, and the… 37 min Day 12 (Advent of Code 2020) Time for the Day 12 problem! In this problem, we have a ship. And we have navigation instructions: Action N means to move north by the given value. Action S means to move south by the given value.… 14 min Day 11 (Advent of Code 2020) Another day, another problem. This time the problem looks suspiciously like Conway’s Game of Life, or, I guess, any old Cellular automaton. We have a map like so: L.LL.LL.LL. LLLLLLL.LL. L.L.L..L..… 13 min Day 10 (Advent of Code 2020) Day, 10! Day, 10! Okay, Day 10. Again, the problem statement is very confusing - but what it all boils down to is this. We have a list of numbers: 16. 10. 15. 5. 1. 11. 7. 19. 6. 12. 4. To which we… 4 min Day 9 (Advent of Code 2020) Day 9’s problem statement is convoluted - the “ah maybe that’s why I don’t usually do Advent of Code” kind of convoluted, but let’s give it a go anyway. So, we have a series of numbers, like so: 35.… 3 min Day 8 (Advent of Code 2020) Time for another Advent of Code 2020 problem! That one sounds like it’s going to be fun. Our input is pretty much assembly, like this: nop +0. acc +1. jmp +4. acc +3. jmp -3. acc -99. acc +1. jmp -4.… 6 min Day 7 (Advent of Code 2020) Another day, another Advent of Code 2020 problem. That one seems fun! For some nerdy values of fun. Our input is a set of rules: light red bags contain 1 bright white bag, 2 muted yellow bags. dark… 12 min Day 6 (Advent of Code 2020) The end of Advent of Code 2020 is fast approaching, and we’re nowhere near done. Time to do Day 6! The problem statement here is a little contrived, as uh, as the days that came before it, but that… 8 min Day 5 (Advent of Code 2020) Time for another day of Advent of Code 2020. For Day 5, we’re going to have to do… Let me guess: more parsing? Correct! So there’s an airline that uses binary space partitioning when referring to… 6 min Day 4 (Advent of Code 2020) It’s time for Day 4 of the Advent of Code 2020! Now, I’ve already had a look at the problem statement, at least for part 1, and I’m not particularly excited. But it will allow me to underline some of… 7 min