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.
Etapa 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. Primeiro, we need to somehow save a value forever. Em segundo lugar, se o “salvar” pedaço (the top input) is on, then we need to replace whatever is “salvo” 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.
Etapa 2: Lets Assume Save Is Off
Remember Odd Ticks? In that problem, we were outputting an off and then using a NOT to “salvar” 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)
Nesse caso, we were essentially saving the result of the NÃO 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.
Ótimo, 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 “salvando” the input.
Can we test this? Claro que sim, that’s a good idea. Running it for desligado funciona (until the tests below fail, but we can see there’s no reason for it to suddenly turn sobre and output an sobre signal). Let’s throw an sobre generator and make sure it saves an sobre.
Claro, it wouldn’t be that easy. Nothing a friendly OU can’t fix.
Isso é melhor! I know the Sobre would make it sobre regardless, mas espero, you can see even if we could take that sobre away, the bottom input to the OU would keep it on forever.
Na verdade, in the cases where the save input é desligado, this is exactly the behavior we want! Or in another way of phrasing it, Se o Save Input é desligado E the saved value is sobre, then send an sobre para o delay circuit, or if the Save Input é desligado E the saved value is desligado, output an desligado. We can simplify that a bit; se o Save Input é desligado, 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.
Etapa 3: Lets Add the Ability to Change What We Save
Doce, we have half the problem solved. Now we just need to work out how to ignore whatever we have saved when the save input é sobre, 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! Se o save input é sobre, então o E will ensure whatever we have saved is set to desligado. Nesse caso, 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 era desligado. Here we want the value input, se o save input é sobre. That sounds remarkably similar, so lets try an E 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 “pular” botão. Explaining things isn’t my strongest skill, Contudo, 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.
Isso é tudo o que estamos compartilhando hoje para isso Turing Complete guia. Este guia foi originalmente criado e escrito por renwallz. Caso não atualizemos este guia, você pode encontrar a atualização mais recente seguindo este link.