Mercurial > hg > python
changeset 17:6c9e371b0325
doesn't break, what's there is good, but stuck part-way in 10a
author | Henry S. Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Wed, 25 Mar 2020 19:21:38 +0000 |
parents | a7a10e40b344 |
children | 1cef0e5f5851 6543fcbb8abd |
files | nono.py |
diffstat | 1 files changed, 12 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/nono.py Tue Mar 24 18:57:33 2020 +0000 +++ b/nono.py Wed Mar 25 19:21:38 2020 +0000 @@ -78,6 +78,8 @@ 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 @@ -293,9 +295,16 @@ return False if g>0: # Block a too-small gap - dprint('m2',i-g,i) - for j in range(i+1-g,i+1): - self.newX(j,True) + if rng.step==1: + # forward + dprint('m2f',i-g,i) + for j in range(i+1-g,i+1): + self.newX(j,True) + else: + # backward + dprint('m2b',i+g,i) + for j in range(i+g-1,i-1,-1): + self.newX(j,True) return True def found0(self,i):