I may have accidentally bumped into the idea of adding the values of counter’s…you can find how I made this here.
Now let’s make counter addition:
- Place down two counters(we will call them A and B respectively). Set their target values to 0. (You can set the other settings according to your needs)
- Place down a trigger(we will call it C). Make it a self-recurring trigger(you can either do this with channels or wire repeaters).
- Make C decrement A when it is triggered, and have C increment B when triggered. Now have A deactivate C when A reaches its target value.
- Now add another trigger(we will call it D), and have it also be a self-recurring trigger.
- Have A trigger D when target reached. Have D decrement B and increment A when triggered. Have B deactivate D when target reached.
There you have it, counter addition, a memory-efficient way to perform addition. Best part: without blocks!
Finish:
Extra
If you want to store the output of your addition operation then just copy the value A to E(which is our counter to store the result). We achieve this by placing down 2 counters(one with target 2 and another with target 3) and have them update when the targets of A and B are reached.
PS: we will call these counters I(target 2) and J(target 3) respectively.
Now add counter E as well as counter F. Have F have a target of 0. Add two triggers(G and H respectively). G should trigger when I reaches their target value. Have G increment E and F, but decrement A. Have G deactivate when J reaches their target.
Have H decrement F and increment A, and have H trigger when J reaches their target. Have H deactivate when F reaches their target.
DONE!