Circuit net: help with saving max value in a memory cell
Posted: Sat Nov 04, 2017 5:51 pm
Hi again!
So my base is growing and new question appears.
I'm an engineer in life but it's a shame to admit - I'm stupid in factorio circuit network logic.
I cannot get how game ticks influence logic circuits that I design,
Maybe you can help me.
So, I have a chest that is filled with something like the following (one number - one, let's say, second, let's call this chest "C")
And below is what I need my memory to display (let's call it "Z"):
C: 0-1-0-0-0-0-2-2-1-1-0-0-0-0-0-3-3-2-1-0-0-0...
Z: 0-1-1-1-1-1-2-2-2-2-2-2-2-2-2-3-3-3-3-3-3-3...
I hope you got it. Will be glad to the complete solution.
But if you are interested, here is how I do it, maybe you can just correct me.
This is my solution: Combinators are following:
My logic is the following:
Z - resulting variable, A - temporary.
Decider combinator sends 1 in case input signal is larger that Z
Arithmetic combinator than adds this 1 to resulting signal.
If it's not enough and input decider signal is still larger than Z, decider still sends 1,
And arithmetic combinator adds 1 again,
After signals get equal or input becomes less, decider combinator sends nothing, so arithmetic combinator just adds 0 constantly, keeping Z constant.
But what I'm getting is following:
C: 0-1-0-0-2-1-0-0-3-3-2-2-1-1-0-0-0-4-3-2-1-0-0-0...
Z: 0-2-2-2-2-2-2-2-4-4-4-4-4-4-4-4-4-6-6-6-6-6-6-6...
I just don't know what's wrong here...
So my base is growing and new question appears.
I'm an engineer in life but it's a shame to admit - I'm stupid in factorio circuit network logic.
I cannot get how game ticks influence logic circuits that I design,
Maybe you can help me.
So, I have a chest that is filled with something like the following (one number - one, let's say, second, let's call this chest "C")
And below is what I need my memory to display (let's call it "Z"):
C: 0-1-0-0-0-0-2-2-1-1-0-0-0-0-0-3-3-2-1-0-0-0...
Z: 0-1-1-1-1-1-2-2-2-2-2-2-2-2-2-3-3-3-3-3-3-3...
I hope you got it. Will be glad to the complete solution.
But if you are interested, here is how I do it, maybe you can just correct me.
This is my solution: Combinators are following:
My logic is the following:
Z - resulting variable, A - temporary.
Decider combinator sends 1 in case input signal is larger that Z
Arithmetic combinator than adds this 1 to resulting signal.
If it's not enough and input decider signal is still larger than Z, decider still sends 1,
And arithmetic combinator adds 1 again,
After signals get equal or input becomes less, decider combinator sends nothing, so arithmetic combinator just adds 0 constantly, keeping Z constant.
But what I'm getting is following:
C: 0-1-0-0-2-1-0-0-3-3-2-2-1-1-0-0-0-4-3-2-1-0-0-0...
Z: 0-2-2-2-2-2-2-2-4-4-4-4-4-4-4-4-4-6-6-6-6-6-6-6...
I just don't know what's wrong here...