changeset 37:6543fcbb8abd actOnZero

stop some/most cross-checks, but x out a 0-counted cell in step processing
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Wed, 25 Mar 2020 21:44:13 +0000
parents 6c9e371b0325
children 1c0d430b0fb1
files nono.py
diffstat 1 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/nono.py	Wed Mar 25 19:21:38 2020 +0000
+++ b/nono.py	Wed Mar 25 21:44:13 2020 +0000
@@ -72,14 +72,16 @@
         yield [-v,r]+sub
 
   def step(self,pos):
+    changed=0
     if self.runs==[]:
-      return 0
+      for i in range(self.n):
+        if self[i].val is None:
+          changed+=1
+          self.newX(i)
+      return changed
     scratch=[0 if c.val is None else c.val for c in self]
     wins=0
-    changed=0
     for k,runs in enumerate(self.allRuns):
-      if (self.m.loop,self.cLet,pos,k)==(1,'R',7,5):
-        print(self.m)
       dprint('=====pass %s.%s.%s.%s======'%(self.m.loop,self.cLet,pos,k))
       if self.onepass(self.margin0,self.marginN+1,scratch,runs.copy()):
         wins+=1
@@ -88,6 +90,10 @@
     inSeq=None
     j=None
     for i in range(self.n):
+      if scratch[i]==0:
+        # Never blobbed, if not x already x it
+        if self[i].val is None:
+          self.newX(i)
       if scratch[i]>=wins:
         # If blobby in _every_ pass, then must be a blob
         if inSeq is None:
@@ -194,6 +200,7 @@
     eprint("Shouldn't happen? - fell through",stack,i,iBound,err=102)
 
   def checkX(self,pos,crosspos):
+    return
     # New x at pos, are there others that can be xed out now?
     # Overkill as is?
     dprint('cx',self.cLet+str(crosspos),pos)