Trying to wrap my head around some logic... wanna help?

    Joined
    Nov 3, 2014
    Messages
    624
    Reaction score
    286
    • Community Content - Bronze 2
    • Wired for Logic
    • Legacy Citizen 6
    ok i dunno why this causes me so many headaches normally i would consider myself decent with logics but either i have to fight the order in which blocks get updated or idk - this seems tricky.

    Simply i want to make

    if(condition){
    for(i=0;i<6;i++){
    if(i<5){
    do X;
    } else {
    do Y;
    }
    }
    } else {
    i=0;
    }

    so we got a condition as Activationblock A if meet will be high.
    we got a clock that every few gameticks will be high for a few game ticks and then will be low for another few game ticks
    if Activationblock A is on low i is set to 0 aka the logic counters needs to reset.

    i was tinkering around with some rsnor latches / T-flipflops but it seems some AND blocks are updated before a certain NOT block and thus toggle the latch part of the flipflop even though the logic should not.

    Help would be appreciated

    Screen Shot 2015-01-19 at 14.00.03.png

    the delay was my attempt to fix the update order which ofc was not working for it would just delay the false output for another clockcycle...

    activation block to the left is the clock and from the top is coming the condition into the left lower or...
     
    Joined
    Jul 21, 2013
    Messages
    2,932
    Reaction score
    460
    • Hardware Store
    The update order of logic blocks is dependant on their location. That is why I had to use a double delay in my T-flipflop to make it compatible with every possible location and rearrangement. You can find a (badly explained) tutorial on it here.
     
    Joined
    Nov 3, 2014
    Messages
    624
    Reaction score
    286
    • Community Content - Bronze 2
    • Wired for Logic
    • Legacy Citizen 6
    Thanks gonna try that as soon as i get back into the game...