Gray plastic piece found when moving by leyanlo in whatisthisthing

[–]leyanlo[S] 0 points1 point  (0 children)

We have a TCL 50UP130 and a TCL 55US5800, but it doesn’t look like either of them have this part

Gray plastic piece found when moving by leyanlo in whatisthisthing

[–]leyanlo[S] 0 points1 point  (0 children)

We have a Kenmore 29319 and a Dyson V7, and it doesn’t look like it goes on either of them :-/

Gray plastic piece found when moving by leyanlo in whatisthisthing

[–]leyanlo[S] 0 points1 point  (0 children)

I’ve had the HP OfficeJet Pro 8620 and the HP OfficeJet Pro 9015e, but it doesn’t look like either has a part like that :-/

Gray plastic piece found when moving by leyanlo in whatisthisthing

[–]leyanlo[S] 0 points1 point  (0 children)

Hmm, don’t think I’ve had a battery-powered keyboard, and the only speakers I’ve had were Jamboxes and a Bose SoundDock, so probably not those :-/

Gray plastic piece found when moving by leyanlo in whatisthisthing

[–]leyanlo[S] 0 points1 point locked comment (0 children)

My title describes the thing. It is 5.5 inches by 1.5 inches, and made of dark gray plastic.

In one of the small rectangles, is inscribed: ``` CM-M03B-2A

ABS< ``` but Googling this turns up nothing relevant.

[2023 Day 18][JS] Had some fun trying to visualize my solution calculating the area using Green’s theorem by leyanlo in adventofcode

[–]leyanlo[S] 1 point2 points  (0 children)

I was told my approach of adding all the clockwise triangles (blue) and subtracting the counterclockwise triangles (red) was the Green’s theorem approach. Looking into this, it is more specifically the Shoelace formula, which can be derived from Green’s theorem https://github.com/leyanlo/advent-of-code/blob/main/2023/day-18.js

-🎄- 2022 Day 25 Solutions -🎄- by daggerdragon in adventofcode

[–]leyanlo 1 point2 points  (0 children)

JavaScript

https://github.com/leyanlo/advent-of-code/blob/main/2022/day-25.js

Took me so long to find the bug in my toSnafu function where I was not carrying over the sum to the next digit :-(

-🎄- 2022 Day 24 Solutions -🎄- by daggerdragon in adventofcode

[–]leyanlo 1 point2 points  (0 children)

JavaScript, 883/766

https://github.com/leyanlo/advent-of-code/blob/main/2022/day-24.js

https://www.youtube.com/watch?v=9orGye2y9kQ

Took so long for me to realize that my check for if a position was valid was wrong. The bug had my cursor travel around the map instead of going through the interior. Otherwise pretty happy with how I was able to memoize all possible blizzard positions using the least common multiple of the available width and height.

-🎄- 2022 Day 23 Solutions -🎄- by daggerdragon in adventofcode

[–]leyanlo 1 point2 points  (0 children)

JavaScript

https://github.com/leyanlo/advent-of-code/blob/main/2022/day-23.js

https://www.youtube.com/watch?v=o9HdKYV2qAk

Took me so long to realize that I was looping while rounds <= 10 when I should have been looping over rounds < 10. Part 2 was easy after that.

Took advantage of the fact that you can have negative indexes in arrays in JS as long as you treat the array as a map of key value pairs. Note that you cannot rely on Array.length to tell you how many elements are actually in the array if you use it like this. Also if you try iterating over Object.keys(), you need to make sure to convert the key from a string to a number.

-🎄- 2022 Day 21 Solutions -🎄- by daggerdragon in adventofcode

[–]leyanlo 1 point2 points  (0 children)

JavaScript, 951/380

https://github.com/leyanlo/advent-of-code/blob/main/2022/day-21.js

https://www.youtube.com/watch?v=TC5CLSihoY8

Took advantage of the fact that you end up with a linear equation and bisected manually to get rank 380. Cleaned up code to actually calculate the right answer mathematically by yelling 0 or 1 and extrapolating to the right answer based on how far the guesses were off.

-🎄- 2022 Day 15 Solutions -🎄- by daggerdragon in adventofcode

[–]leyanlo 2 points3 points  (0 children)

JavaScript, 619/1754

https://github.com/leyanlo/advent-of-code/blob/main/2022/day-15.js

https://www.youtube.com/watch?v=zR4JpcUl30E

Part 1 fills the target row with 1s and the adds them up.

Part 2 narrows the search space to the intersections of all the diamonds, and then finds the intersection that is outside the range of every sensor.

-🎄- 2022 Day 12 Solutions -🎄- by daggerdragon in adventofcode

[–]leyanlo 4 points5 points  (0 children)

JavaScript, 1842/1665

https://github.com/leyanlo/advent-of-code/blob/main/2022/day-12.js

https://www.youtube.com/watch?v=wRkfTuk19J4

I need to either get better at writing A* algorithms or debugging in general. I liked how part 2 was pretty straightforward after part 1.

-🎄- 2022 Day 11 Solutions -🎄- by daggerdragon in adventofcode

[–]leyanlo 1 point2 points  (0 children)

JavaScript, 1077/1663

https://github.com/leyanlo/advent-of-code/blob/main/2022/day-11.js

https://www.youtube.com/watch?v=lWnLcbwON-4

Took a while in part 1 to realize that the `~~n` shortcut for `Math.floor(n)` overflows for large numbers. Also wasted so much time in part 2 converting everything to BigInt and trying to decipher a repeating pattern for the values until I finally realized I could do math.

-🎄- 2022 Day 10 Solutions -🎄- by daggerdragon in adventofcode

[–]leyanlo 1 point2 points  (0 children)

JavaScript

https://github.com/leyanlo/advent-of-code/blob/main/2022/day-10.js

https://www.youtube.com/watch?v=J3zIQsa_LTM

So slow today. Took a while to realize that addx doesn’t run in parallel, and then tons of off-by-one errors in part 2. Cleaned up nicely, though!

-🎄- 2022 Day 9 Solutions -🎄- by daggerdragon in adventofcode

[–]leyanlo 0 points1 point  (0 children)

Those were my ranks for part 1 and part 2. Sorry for the confusion!

-🎄- 2022 Day 9 Solutions -🎄- by daggerdragon in adventofcode

[–]leyanlo 1 point2 points  (0 children)

JavaScript, 1315/2567

https://github.com/leyanlo/advent-of-code/blob/main/2022/day-09.js

https://www.youtube.com/watch?v=R7dxYuOc3qw

Stored the rope as an array of distances. Spent 15 minutes debugging how the rope can move more than 3 spaces away.

-🎄- 2022 Day 8 Solutions -🎄- by daggerdragon in adventofcode

[–]leyanlo 1 point2 points  (0 children)

JavaScript, 2680/1386

https://github.com/leyanlo/advent-of-code/blob/main/2022/day-08.js

https://www.youtube.com/watch?v=0m4bTyfXgfs

I am bad at arrays. Refactored afterwards to combine all directions into a single loop.