A walkthrough of one of Turing Complete’s hardest levels to grep. Saving Gracefully after the new December 2021 patch replaced SR Latches with delay circuits. I’ve seen a few people struggling with this level, so I decided to write an illustrated guide that builds up an answer with you. The answer shown here isn’t necessarily the most efficient, but we’re here to understand, not just copy-paste.
Krok 1: What do we have to do?
According to our long-nosed alien friend, we’re building a circuit that can save a value, and output whatever value is currently saved.
Breaking that down a bit more, there are a few different tasks we’re actually required to do here. Pierwszy, we need to somehow save a value forever. Po drugie, if the “ratować” fragment (the top input) jest włączony, then we need to replace whatever is “zapisane” with the value in the bottom bit.
That second part sounds tricky, but let’s start with the first and see how we can build off of that.
Krok 2: Lets Assume Save Is Off
Remember Odd Ticks? In that problem, we were outputting an off and then using a NOT to “ratować” an on, and then in the next tick doing the same thing but with opposite values. That sounds complicated, so let us use a picture.
(You can rotate components with the space bar)
W tym przypadku, we were essentially saving the result of the NIE of the last tick’s value. One way of thinking about this is we are outputting whatever is in the delay circuit, and putting the output we want for the next tick into the delay circuit. So the obvious way to save a value here would be to just loop back on itself. Lets try that.
Świetnie, now we have a save loop. Whatever is output from the delay circuit will get fed back into it, and we’ll be golden. For simplicities sake, I’m going to refer to whatever input we’re sending to the delay circuit as “oszczędność” the input.
Can we test this? For sure, that’s a good idea. Running it for wyłączony fabryka (until the tests below fail, but we can see there’s no reason for it to suddenly turn NA and output an NA signal). Let’s throw an NA generator and make sure it saves an NA.
Oczywiście, it wouldn’t be that easy. Nothing a friendly LUB can’t fix.
To jest lepsze! I know the NA would make it NA regardless, but hopefully, you can see even if we could take that NA z dala, the bottom input to the LUB would keep it on forever.
W rzeczywistości, in the cases where the save input Jest wyłączony, this is exactly the behavior we want! Or in another way of phrasing it, Jeśli Save Input Jest wyłączony I the saved value is NA, then send an NA do delay circuit, or if the Save Input Jest wyłączony I the saved value is wyłączony, output an wyłączony. We can simplify that a bit; if the Save Input Jest wyłączony, then send whatever is in the delay circuit back to itself, so that we can output it on the next tick.
Let’s make a Truth Table (those things in the earlier levels that show what the output should be forgiven inputs).
I encourage you to try and build that yourself, but here’s how that might look:
Here I’m using orange to signify our save loop, and light blue to show our save input. I recommend getting in the habit of coloring wires into logical groups like this, you’ll be glad you did on the later levels.
Krok 3: Lets Add the Ability to Change What We Save
Sweet, we have half the problem solved. Now we just need to work out how to ignore whatever we have saved when the save input Jest NA, and instead save whatever is in the value input. That sounds tough, but lets start playing around.
Well actually, looking at our circuit again, we’ve got more than half the problem solved! Jeśli save input Jest NA, then the I will ensure whatever we have saved is set to wyłączony. W tym przypadku, all we need to do is grab the value from the value input and write it to the delay circuit.
Ach, we’re so close, but there’s an error here. We’re saving the value of the value input, even when the save input is not set. We only want to save that value if the save input jest włączony, so lets use some logic again to work out how.
Looking back at our save logic, we wanted the saved value if the save input był wyłączony. Here we want the value input, if the save input Jest NA. That sounds remarkably similar, so lets try an I gate again.
Hit play and… we’re done!
Inny
This isn’t the most efficient way to solve the level, but that’s not the point. I wanted to show the steps you can take to solve it yourself so that you can understand the level and not just get a “skip” przycisk. Explaining things isn’t my strongest skill, Jednakże, so if there’s something that’s still unclear or a different way of thinking that made it click for you, please share in the comments below!
This level is hard because it’s one of the first that requires you to break down the problem into sub-problems without making it obvious that you should. Being able to look at a problem and simplify it down to the smaller, easier sub-problems will get you further in this game than any CS degree or computing background at all, so I recommend keeping it in mind in future levels where the problems get larger and larger.
It works in real life too, but I’m only here to help with Saving Gracefully, Living Gracefully is still up to you.
To wszystko, co dzisiaj udostępniamy w tym celu Turinga w komplecie przewodnik. Ten przewodnik został pierwotnie stworzony i napisany przez renwallz. Na wypadek, gdybyśmy nie zaktualizowali tego przewodnika, możesz znaleźć najnowszą aktualizację, postępując zgodnie z tym połączyć.