vortiforlife.blogg.se

N11 tick time tracking
N11 tick time tracking






n11 tick time tracking
  1. N11 TICK TIME TRACKING HOW TO
  2. N11 TICK TIME TRACKING CODE
n11 tick time tracking

  • But nothing we did in the previous set of steps depended on having a 3-quad specifically.
  • We’ve just seen here that we can use that fact to take a 3-quad forward one tick to make a 2-quad stepped forward one tick.
  • We can take a 2-quad forward one tick to make a 1-quad with our base case.
  • We do that four times and from those 1-quads we construct the center 2-quad moved one step ahead: We make the light blue 2-quad out of four of the blue 1-quads, and then the center 1-quad of that thing is: I’ll just show the northwest corner you’ll see how this goes.

    N11 TICK TIME TRACKING CODE

    We then make four 2-quads from those nine: and extract the center 1-quad from each using the Center function (source code below). We then move each of those one step ahead to get the blue 1-quads. I’ll draw the original 3-quad in light green, and we can extract component 2-quads from it that I’ll draw in dark green. We can use a similar trick as we used with QuickLife to get the north, south, east, west and center 2-quads of this 3-quad, and move each of them ahead one step to get five more 1-quads. We compute the next generation of its four component 2-quads the green quads are current, the blue are stepped one ahead. Suppose we have the 3-quad from the image above. Remember in QuickLife the key was observing that if we had nine Quad2s in the old generation, we could compute a Quad3 in the new generation with sixteen steps on component Quad2s. How? We’re going to use almost the same technique that we used in QuickLife. The key insight is: for any n>=2, if you have an n-quad in hand, you can compute the (n-1) quad in the center, one tick ahead. The interesting bit comes in the recursive step. We’ve seen this half a dozen times before. We’ll get all sixteen cells in the 2-quad as numbers: private static Quad StepBaseCase(Quad q)Īnd count the neighbours of the center 1-quad: int n11 = b00 + b01 + b02 + b10 + b12 + b20 + b21 + b22 We will use 2-quad-to-1-quad as our base case.įor the last time in this series, let’s write the Life rule: private static Quad Rule(Quad q, int count) The QuickLife algorithm memoized only the 2-quad-to-center-1-quad step algorithm we’re going to do the same thing but with even more memoization. We have a recursively defined quad data structure, so it makes sense that the step algorithm will be recursive.

    n11 tick time tracking

    Remember a few episodes ago when we were discussing QuickLife and noted that if you have a 2-quad in hand, like these green ones, you can get the state of the blue 1-quad one tick ahead? And in fact we effectively memoized that solution by simply precomputing all 65536 cases. How do we step it forward one tick? (Code for this episode is here.)

    N11 TICK TIME TRACKING HOW TO

    All right, we have our quad data structure, we know how to get and set individual elements, and we know how to display it.








    N11 tick time tracking