Tricky Maths question: How do I get a trigger zone to send out TWO numbers, and not just one?
I'm doing a grid, and each square will TAKEAWAY a number from an overall total (in this case, 50). So, for example, square one will takeaway / subtract just one number (making it 49). The next will takeaway / subtract two (making it 47), and so long, until we reach 0.
My current layout is that I have a trigger zone on a square, and this trigger zone is connected to a counter. The counter is then threaded to takeaway/subtract gadget, which is then threaded to a number displayer.
In layman's terms, the trigger zone will trigger the counter to move up one, which is then taken away straight afterwards, making it 49 (and not 51, which it would do if it weren't for the subtract gadget).
There are two problems: one, I am absolutely atrocious at maths, and two, I want the trigger zone to make the counter take away two numbers, not just one.
I don't know how else I can do this, so I feel that I *need* the trigger zone to register a move, but I cannot find a way to have it outpost two moves and not just one.
TLDR; I want to have squares on a grid take away more than one number from a total amount. IE:
Square one - 1 number from 50
Square two - 3 away from 50
Square seven - 8 away from 50
Anyone have any ideas? I've tried to make this as simple as possible, and in theory it is, but I can't figure it out.
-
I can't really understand what you're trying to do from the description. But just based on the title, you could wire the trigger zone to two separate calculator gadgets set to subtract different amounts.
-
I'm not sure what being poor at maths has to do with it since you only want to subtract 1 multiple times! Anyway sounds like you want a trigger zone that can be configured to output a certain number of pulses rather than just 1.
I would make a microchip with a trigger zone on it. Include a value slider where you configure your decrement (1, 3 or 8 in your example). Add an output node. Then you use a combination of a timer and a counter to output the right number of pulses. The chosen decrement will be wired to the target value of the counter (forget the exact name). Then a timer is used to create a delay before incrementing the timer again. I'm glossing over the details I know. I could share a version of this.
Then you have a chip that you can clone and configure as many times as you need rather than having lots of trigger zones wired up to a whole mess of logic. -
'@David: This sounds like the sort of thing I was trying to do, I just didn't know how, so thank you! I'll give that a shot and see. I know the solution is likely to be simple, but I'm just having a hard time figuring out how, and that sounds about right!
@Magnus: Yeah, I tried to make it as clear as possible. Sorry! -
I think David's solution sounds good, but one thing that might make your work easier is using a variable rather than a counter (hugely dependent on what you're working on).
Create one variable (give it a name!), and then for each square create a variable modifier, set it to 'Add' mode, enter the variable's name, and attach the trigger pulse to its power, and set the value in the variable modifier as you wish.
Iniciar sesión para dejar un comentario.