Before you continue, you should familiarize yourself with propler coding techniques, to avoid problems in the future. Once you add more features, the current code will become incomprehensible.
- Use the correct representation for the indicators
- SInce you only use "replace array subset", the array size never changes so it is not needed to measure it at each iteration.
- "Index array" and "replace array subset" are resizeable. If you work with consecutive indices, you only need to wire the top, unwired indices will be "+1" of the one above it.
- Don't use wires going from left to right.
- There are "+1" and "-1" primitives.
- You have three "120" diagram constants right next to each other. One is enough, just branch the wire.
- It is sufficient to calculate "2*(x+1)" once. You do it twice for the same wire value.
- ....
The attached picture shows one way how the same code could look like if you would follow some of the points above. And, yes, as others have said, you need to stop the loop with a stop button so the following code can executed. 😄
EDIT: And yes, as smercurio_fc points out above, some of the math is way too convoluted. I did not try to make sense of it. 🙂

Message Edited by altenbach on
04-15-2008 11:39 AM