« first day (4889 days earlier)      last day (338 days later) » 

3:16 AM
GWD ready for sure
Should probably make some diamond bolts but ehhhhhh it's fine
And should probably make a dhide shield of some sort
Though black dhide shield is redwood logs rip
3:39 AM
Oh I have like 150 diamonds lol
So ya diamond bolts it is
 
8 hours later…
11:49 AM
Day 3 proved both harder and easier than expected. At first I thought "oh this is super easy", and then I started to think more about it and was thinking "oh wait shit, this is really tricky" and then I started coding and was all "oh wait nevermind, but still harder than I originally thought"
It was quite the rollercoaster
 
3 hours later…
2:50 PM
Yeah it was an interesting one today, I got a bit sidetracked after I finished with why my parsing function was taking a long time (10ms) but I managed to optimised it to get back in line with previous days' performances
 
2 hours later…
4:24 PM
@Ronan Just curious, did you use regex at all?
I'm making it a point to use regex more often this year, and so far, it's paying off quite well.
@Wipqozn Yeah, I always use regex extensively in AoC
The issue wasn't with that, it was finding which part the number was associated was slow because I was checking every single part to see if it was within the right area
@Ronan Oh I wasn't asking because I assumed it was causing problems.
I don't actually know how efficient regexes are in js, it seems comparable to other methods of searching strings but haven't actually checked how fast it is in general
Today I used regex to find all the numbers on a line, and then I figured out what their start and end coordinates are. I wasn't going to use regex originally, but it just made things a lot easier.
@Ronan Looks like we determined adjacency the same way. aka we used math checking coordinates instead of keeping a huge ass array and crawling through it. I think there were a lot of people on /r/adventofcode that used the array method, and it's making it way more difficult and error prone.
@Wipqozn Nah I still ended up with an array of parts I had to check
4:39 PM
@Unionhawk Perfect
I haven't even started yet
@Unionhawk What a slacker
It'll probably be some really stupid 2d array but we'll see
 
1 hour later…
6:09 PM
@Wipqozn @Ronan you both made the mistake of looking for the numbers instead of looking for the symbols.
@MBraedley I considered that, but it's much easier once you know where a number is to check for symbols, whereas from a given symbol there's way more places you need to check for numbers of arbitrary length
You only need to find the start index by working left. Also I used sets to prevent duplicates.
@MBraedley Not sure what you mean
And we're eventually going to need to get all eight neighbors for a puzzle, so might as well implement that now.
Not all numbers have a symbol next to it, but it looks like all symbols are next to a number. My parsing sucks because it's character by character, could have done first_not_of but that would have taken more thought to get right, and then I have 3 loops that could probably get condensed.
6:28 PM
@MBraedley Yes, but all you care about is if each number is adjacent to a single symbol.
So if you search around each symbol, you'll check some numbers multiple times. If you search around numbers, you can stop checking what's around it as soon as you find a symbol.
Yeah, and how did part 2 work out for you?
@MBraedley Easily. Just a few additional lines.
@Wipqozn this is why I used sets.
Although if you search around symbols for part 1, you could remove a number from your check list for all future symbols
@MBraedley I know, what I mean is it's additional checks
... That the standard library handles for me
It was also obvious to me that it was more important to know where each of the symbols are rather than the numbers.
6:38 PM
@MBraedley I know where both were. I just track a symbol and numbers position using x, y coordinates.
Same here
 
1 hour later…
7:47 PM
anyways, home now, so here's my solution: github.com/Wipqozn113/adventofcode/blob/main/2023/day3/p2.py
@MBraedley
That GearNumber() function is the main thing I added to make part 2 work.
8:18 PM
My part 1 solution has no relation to part 2

« first day (4889 days earlier)      last day (338 days later) »