day 24 - advent of code 2024

  Рет қаралды 890

chris biscardi

chris biscardi

Күн бұрын

Advent of Code: adventofcode.com/
Rust Adventure Discord advent of code channel: / discord
The code from the video (and more): github.com/Chr...

Пікірлер: 7
@BenoîtBurnichon
@BenoîtBurnichon Ай бұрын
I have an electronics degree and I knew right from the problem statement what the graph would look like and that you should walk your way from "adding" bits from the least significant to the most significant while checking carries were propagated as expected. Well done doing it via dotgraph visualization even though you did not know the pattern beforehand. Hopefully they did not implement a fast carry adder it would have been really a nightmare to debug.
@fyellin
@fyellin Ай бұрын
Yeah. It was clear that they were implementing a half-adder followed by 42 full adders. Once I was able to reliably identify the carry-in at each step, finding the swaps became much easier.
@talideon
@talideon Ай бұрын
There's a hint in the input, or at least there was for mine: of dump each ordered by the z pin as an equation and look at it, the pattern of the initial half adder followed by a series of full adders with carry becomes super obvious: it's a ripple carry adder. Where I fell into a trap was that I attempted to write something to recognise the sequence of operations, which was fine until I got to the final bit and added some conditiona to recognise the carry base on an initial OR (XOR was my signal to recognise a half/full adder), as this tripped up on an earlier equation as the swap was being done between the adder and the carry logic, but at that point, I knew which pins to flag, so I shrugged and didn't spend any more time on it. In retrospect, it might've been better to just check if the Z corresponded to the expected X/Y inputs and kept track of the carries myself. 🤦 I was trying far to hard to detect _where_ the swaps were occurring in each equation rather than focusing on the relevant bit, which is identifying the bad outputs.
@aderakin5395
@aderakin5395 Ай бұрын
today's problem was very interesting, different from all previous days for sure. First day I had to look up the answer lol. It seems that the majority of answers are fixing the gates manually so petgraph came in handy.
@flwi
@flwi Ай бұрын
Rofl. I got stuck and checked your approach to part 2. I'm curious how you're going to bench 100 photoshop sessions 45:15. maybe you'll get faster over time? 😂 Anyway. I like your approach of visualizing the whole graph and then debugging it. Actually makes me happy, because I often do that (or end up with a bunch of sheets of paper) when I try to understand/debug the problem. In the youtube videos the solves sometimes look quite streamlined, so it's nice the you also use those tools.
@chrisbiscardi
@chrisbiscardi Ай бұрын
haha, there's gotta be a speedrun category for photoshop. and yeah, especially for advent of code I try to keep the debugging process in. I am not a competitive programmer in general so it gives me a chance to put myself in the shoes of people who are just learning Rust and show how to find functions in the docs, how to debug, etc.
@flwi
@flwi Ай бұрын
very valuable indeed. I have one year experience with rust now and often learned one or two things every day from your videos. Watched them after I solved it myself and then do some refectorings.
day 25 - advent of code 2024
13:42
chris biscardi
Рет қаралды 770
Keynote: Advent of Code, Behind the Scenes - Eric Wastl
46:01
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН
The Dark Matter of AI [Mechanistic Interpretability]
24:09
Welch Labs
Рет қаралды 152 М.
day 23 - advent of code 2024
50:00
chris biscardi
Рет қаралды 545
AI Is Making You An Illiterate Programmer
27:22
ThePrimeTime
Рет қаралды 296 М.
Catching up with async Rust
17:55
fasterthanlime
Рет қаралды 31 М.
12 months with the Bevy Game Engine - This Year in Bevy 2024
9:23
chris biscardi
Рет қаралды 10 М.
Stop using std::vector wrong
23:14
The Cherno
Рет қаралды 172 М.
Entity Relationships and Contact Projective Decals - This Week in Bevy
7:39
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН