     #wait for the cycle  
     result = {cycle: false}
     patternEvolution rule, pattern, time, (curPattern, t) ->
+      dt = t-time
+      if dt is 0 then return true
       Cells.sortXY curPattern
-      dt = t-time
       eq = Cells.shiftEqual pattern, curPattern, mod2 dt
       if eq
         result.cycle = true

console.log "#### dp:  #{JSON.stringify determinePeriod rule, pattern1, 0}"

#1-cell
pattern2 = Cells.from_rle "oo"
v2 = patternDelta determinePeriod rule, pattern2, 0

library = new Library rule

console.log "Two velocities: #{v1}, #{v2}"
[freeIndex, freeOrt] = opposingOrt v1, v2

  while true
    phase = mod2 time
    sub_rule_idx = mod time, vacuum_period
    if sub_rule_idx is 0
      break unless callback curPattern, time
    curPattern = evaluateCellList stable_rules[sub_rule_idx], curPattern, phase
    time += 1
  return

class Library
