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.
Step 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. First, we need to somehow save a value forever. Secondly, if the “save” bit (the top input) is on, then we need to replace whatever is “saved” 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.
Step 2: Lets Assume Save Is Off
Remember Odd Ticks? In that problem, we were outputting an off and then using a NOT to “save” 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)
In this case, we were essentially saving the result of the NOT 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.
Great, 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 “saving” the input.
Can we test this? For sure, that’s a good idea. Running it for off works (until the tests below fail, but we can see there’s no reason for it to suddenly turn on and output an on signal). Let’s throw an on generator and make sure it saves an on.
Of course, it wouldn’t be that easy. Nothing a friendly OR can’t fix.
That’s better! I know the On would make it on regardless, but hopefully, you can see even if we could take that on away, the bottom input to the OR would keep it on forever.
In fact, in the cases where the save input is off, this is exactly the behavior we want! Or in another way of phrasing it, If the Save Input is off And the saved value is on, then send an on to the delay circuit, or if the Save Input is off And the saved value is off, output an off. We can simplify that a bit; if the Save Input is off, 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.
Step 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 is on, 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! If the save input is on, then the AND will ensure whatever we have saved is set to off. In this case, all we need to do is grab the value from the value input and write it to the delay circuit.
Ahh, 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 is on, 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 was off. Here we want the value input, if the save input is on. That sounds remarkably similar, so lets try an AND gate again.
Hit play and… we’re done!
Outro
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” button. Explaining things isn’t my strongest skill, however, 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.
That's everything we are sharing today for this Turing Complete guide. This guide was originally created and written by renwallz. In case we fail to update this guide, you can find the latest update by following this link.