« first day (4539 days earlier)      last day (796 days later) » 

03:08
These last 2 days are kicking my ass.
I thought todays part 1 was easy, but the movement is just going wrong somewhere
not sure where,. since it's right for everything listed in the example.
Got a full output of the example.... so going to compare, see where my starts to go off
03:21
Apparently it goes wrong at line 2702....fun
03:39
Oh no have that backwards
But still, I'm done for tonight
04:07
I somehow managed to write an algorithm for today that produces the correct output for part 1, but is very slightly off for part 2
04:59
I thought I realized my bug whiule laying in bed, BUT ALAS, I did not
Still, I have an idea.
05:23
PArt 1 day 18 done. That was easy.
Part 2 is more tricky
okay I need to go to bed... or well, back to bed. Will worry about part 2 tomorrow.
along with the days I haven't done, ha. That said, not too worried about part 2. Just need to expand my models some.
05:41
ooorr I could tyhink up the solution in bed
so naturally, here we are
thank christ I'm off the rest of the year
Lol
I'm so far behind. I really need to get working on it again
05:59
okay I got the foundatio nupdated. Now I just need to build the flood fill basically... but okay I'm fucking exhusted haha
tomorrow is enough.. or well, later today
 
7 hours later…
12:35
okay, I feel dumb. Why haven't I been using numpy, ha.
I've never used it before, but infally decided to.
 
2 hours later…
14:57
yeah today was easier than previous days. Not surprised... he's done this before. Tones it done after a few harder days.
15:22
Yeah it was straightforward, I spent a while trying to come up with the perfect representation to make it super fast though
I used the opportunity to expand my new utils library with a 3D Coordinate class.
Yeah I was thinking I should go back and make some utils from common classes
I've just been copying the stuff I need every time, makes it easier to change things for individual day use cases
@Ronan You can still do with that with common classes. I did that today to create a modified BFS. Copied my shared one, then tweeked it. The util class is still a benefit though, since it's way easier to find. I don't need to go digging through solutions to find that class I want. Especially helpful when going from year to year.
Yeah but because every time I've used a "common" class this year they've been slightly different, I'm not sure what the util version would look like
15:42
@Ronan Could just be a basic Skeleton?
Does Typescript have Abstract classes?
Yeah, I just need to do it
I'd probably just add a new data structures js lacks, like a hashset with a custom hash function, and then a few functions to do things like floodfill, bfs etc
I don't really need a class for bfs
 
1 hour later…
16:59
1
Q: Who is this guy holding a gold sword who appeared after I returned home via a portal?

Rebecca J. StonesI'm playing Mineclone 5 (a Minecraft clone) single player via Minetest. The second time I returned via the portal, this guy appeared (the first time he didn't appear). He doesn't attack me. If I right click on him, nothing happens. Question: Who is this guy holding a gold sword who appeared ...

@Wipqozn pandas and numpy make so many of them so much easier
I'm kinda regretting using javascript
 
1 hour later…
18:17
I am absolutely stumped with Day 17
I thought maybe there was some odd bug with input... but I tested an online visualizer and nope... it got the right answer
I even added a movement override, just to test rock movements more easily... and everything seems to work fine
but there must be some weird ass edge case causing a bug I'm missing
hmm might dee soemthing, but needf to make my output better
18:38
hmm that mnight be soemthing
That series of lines make no sense
..|.L..
..|.L..
..LLL..
...+...
..+++..
...+...
..----.
.....|.
.....|.
.....|L
Both those L and that + had the ability to move again
THought I tested that situation... but must not have
18:52
Oh no, that could lake sense
Yeah nvm, it falls into it and is fine
19:20
Part 1 or 2?
@Ronan PArt 1
If you send me all 2022 heights I can tell you when it goes wrong?
I was actually just going to download someone elses program and try that myself
I might poke you though, one moment .Either way, thanks for the offer.
20:08
for fuck sake, for some god damn reason this test out put was being encoded as UTC 2 le Bom1?
How I copied it from git must have fucked it somehow
either way, I've now found the line that is wrong,t hank christ
20:22
I have a solution for day 17 that works for the example for part 2, but not for my input for part 2, and I have no idea why
20:35
And I just figured it out
20:46
Just got 16.1 running in "reasonable" time (10s)
Actually, release runs in less than a second.
I know it's not optimal, but I'm still checking every path
21:32
Are you branching for opening vs not opening the valve?
21:47
@murgatroid99 I calculate distances (including opening) between the start and each of the working valves and only "visit" each working valve once.
I'm going through all iterations instead of trusting Dijkstra to give be the optimal answer first, though
I do a simple BFS fill from each working valve over the entire graph to calculate those distances. All the pre-processing (input, parse names, parse connections, calculate distances) takes <20ms
@MBraedley same
I still don't understand understand 17-2
@MBraedley I see, DFS where each step is taking the shortest path to and opening one valve
I'm going to skip 17 for now and go to today. I have some thoughts, I know I probably have to trim lower levels.
I found periodic behaviour like I expected it, and using it gets me the answer I want, but the period is len(input) * len(pieces) * three-digit number
@murgatroid99 or equivalently BFS — exploring the space where both players still have time takes less than 4 minutes and 6.5 billion states
Oh, that's a good point. Wouldn't the period just be the LCM of len(input) * len(pieces)?
22:00
nope
doesn't work out
the metric by which I'm going is increase in tower height
@MBraedley no, because a piece doesn't always use the same number of moves
You have to match move sequence position and the shape it's dropping onto
for my input, every len(input) * len(pieces) chunk adds about 70k lines, but it takes 7³ chunks before the exact number of added rows loops
I thought 7³ to be meaningful because the board is 7 wide, but if I set the board to be 11 wide I get a period of len(input) * len(pieces) * unrelated prime number
also the actual period is MUCH MUCH smaller than that number
I looked for repeats of (shape ID, move number before dropping that shape)
somehow
Yeah, the actual period is LCM(len(input), len(pieces)), but it might not set up for a few iterations.
22:05
nope
I explicitly ignore the first chunk
both len(input) and len(pieces) are prime numbers but the loops are significantly smaller than the products
@MBraedley I'm pretty sure that's not true at all for my input
That's what I'm saying though, it might take several chunks to set up, but eventually it should settle into that lower bound period
No, it's less than that
I have an input size of 10091 and a period of 1725
22:09
I wonder if the input matches /<{7,}/ or />{7,}/
because then len(input) is immaterial
what, why?
every < after the 6th is guaranteed to be useless
You still consume moves that don't change the position of the rock
oh right because the piece spawns 4 above max y
Each move consumed corresponds to the rock moving downward by one space
22:11
so there's not enough vertical space for what I'm saying to be right
Well, it could avoid blocks that are there and fall very far, especially if it's a | piece
And that's also the reason why you can't just look at LCM(len(input), len(pieces)). A single piece could consume few or many moves depending on the current state of the board
oh hey it's @badp
My favourite part of Advent of Code is it sually brings back @badp
I've actually opened this chat room for an important service announcement
Are you having a baby
Okay, it's not LCM(len(input), len(pieces)), it's n*LCM(len(input), len(peices)), and that's the number of jet moves, not the number of peices.
22:18
@Wipqozn much bigger news
@badp you're buying twitter?
@Wipqozn much saner news
@badp You're getting married?
@badp You're buying Facebook?
Sep 26, 2012 at 11:19, by badp
Good news! I'm about to be banned from Quora.
I have been unbanned by Quora
4
22:20
@badp Took you long enough
@badp oh, I thought you finally got banned
I've been unbanned in April 2021 actually but they didn't bother telling me
they finally decided to allow pseudonymity
@MBraedley I don't think that's true of my input either
in other news
Good news! I'm about to be banned from Twitter.
22:21
I just realized pinning that makes sense
@badp yeha I'm thinking of checking out this elephant thing
@murgatroid99 It has to be. You can't have cycles without that being true.
The length of the cycle I'm looking for is necessarily a multiple of the length of the input, but I'm pretty sure it just is the length of the input
Mastodon is cozy and quiet, you just have to survive the period where what all the new users have nothing meaningful to talk about other than mastodon and twitter
len(pieces) is number of pieces, not the sum of heights or anything like that
@MBraedley Because not every shape dropped uses the same number of moves. So n * len(pieces) pieces dropped can consume a number of moves that is not a multiple of either n or len(pieces)
22:23
Cohost is also pretty good and you can do CSS CRIMES™
but the reblog-first Tumblr model is a little alien to me
and you have to wait a while before you get through the activation queue
@murgatroid99 but a cycle eventually sets up. That can only happen if the number of jets per cycle is an integer multiple of the len(input) and a multiple of len(pieces), and it's probably the LCM, but is definitely n*LCM
@MBraedley No, it's less
It can't be unless the input contains a cycle itself
I don't think you're listening to me
I've rechosted a bunch of cool hacks on my page cohost.org/bp-
@MBraedley I thought this to be true also but reality disagrees
22:27
If shape 1 uses 3 moves, and shape 2 uses 4 moves, etc. Then you can consume e.g. 23 moves by going through all 5 shapes
The cycle length is number of jets, not the number of pieces
jets?
My input has a prime length (I assume they all do) but my cycle length in terms of the jets is just that length
input moves
22:28
ohhhhh
I had never thought of periods in terms of movement used
only in terms of amount of pieces dropped
The point I'm making is that going through 5 shapes can consume the first e.g. 23 moves. And then the next 5 shapes can consume the next e.g. 27 moves. So, 5n pieces can consume your entire input exactly in one pass, and you don't need to iterate through 5 times to get to that point.
@murgatroid99 And that's why you need to calculate cycle length in moves, not peices
@MBraedley And I'm telling you that my cycle length in moves is 10091
Which is the length of my input
Okay, I'm wrong
And it's because a piece might not use the same number of moves of the previous piece.
@Ronan I have a rock floating in mid air
..|....
..|....
..|....
..|....
.......
.......
.......
.+..L..
+++.L..
.+LLL..
.|.....
.|.----
.|.LSS.
.|.LSS.
.LLL+..
22:37
@MBraedley And see, the reason I thought you weren't listening to me is that I stated that multiple times
Takes 84 rocks
@Wipqozn Well there's your problem
@Ronan Seems likely!
I had a feeling that damn L piece was to blame
So my down logic check is obviously off by 1 or something
@murgatroid99 I had failed to consider the input repeat exactly matching up with a pieces repeat.
@MBraedley I didn't even notice that was what happened until we were having this discussion. I was tracking cycles in terms of number of pieces dropped
22:51
oh now it makes sense
.+..L..
+++.L..
.+LLL..
Forgot to account for when a rock is "nested" inside another rock... I thought I did, but it only works if the nested rock is air... meaning it's not nested at all
Every point of my rock checks to see if its being blocked before moving, and part of that check includes "am I looking at myself?"... but I'm just looping through the dimensions where the rock could be.
the + rock sees it can't moev since it's blocked by the L... except it's the L piece that's moving. + shouldn't be checking, but my loop is too naive,so yeha.

« first day (4539 days earlier)      last day (796 days later) »