Changeset 115
- Timestamp:
- 03/22/04 17:22:19 (5 years ago)
- Files:
-
- 06/devel/algosPY.py (modified) (2 diffs)
- 06/devel/kombilo.py (modified) (1 diff)
- 06/devel/patternPY.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
06/devel/algosPY.py
r103 r115 529 529 d = {} 530 530 dNO = 0 531 for i in range(patternList.get(m[0]).sizeX): 532 for j in range(patternList.get(m[0]).sizeY): 533 if patternList.get(m[0]).getInitial(i, j) != '.': 534 d[(i+m[1][0],j+m[1][1])] = patternList.get(m[0]).getInitial(i,j) 535 if patternList.get(m[0]).getInitial(i,j) in ['X', 'O']: 531 p = patternList.get(m[0]) 532 for i in range(p.sizeX): 533 for j in range(p.sizeY): 534 if p.getInitial(i, j) != '.': 535 d[(i+m[1][0],j+m[1][1])] = p.getInitial(i,j) 536 if p.getInitial(i,j) in ['X', 'O']: 536 537 dNO += 1 537 538 … … 540 541 541 542 contList[m] = [] 542 cL = p atternList.get(m[0]).contList.split('/')543 cL = p.contList.split('/') 543 544 for t in cL: 544 545 if t: contList[m].append((ord(t[0])+m[1][0], ord(t[1])+m[1][1], t[2])) 06/devel/kombilo.py
r102 r115 1867 1867 d = self.getPatternFromBoard(self.sel) 1868 1868 cls = [] 1869 1870 print self.currentContList 1871 1869 1872 for c in self.currentContList: 1870 1873 cls.append(chr(c[0]-self.sel[0][0]) + chr(c[1]-self.sel[0][1]) + c[2] + '/') 1871 1874 contListString = join(cls, '') 1872 print 'SEARCH', join(d, '')1875 # print 'SEARCH', join(d, '') 1873 1876 self.currentSearchPattern = Pattern(anchors[0][0], anchors[1][0], anchors[0][1], anchors[1][1], 1874 1877 self.sel[1][0]-self.sel[0][0]+1, self.sel[1][1]-self.sel[0][1]+1, 06/devel/patternPY.py
r103 r115 102 102 for t in contList.split('/'): 103 103 if t: 104 print ord(t[0]), ord(t[1]), t[2]104 # print ord(t[0]), ord(t[1]), t[2] 105 105 helpFinalPos[ord(t[0]) + sizeX*ord(t[1])] = self.BW2XO(t[2]) # ignore captures ... 106 106 … … 144 144 self.bits.append(nextBlock) 145 145 146 self.printPattern()146 # self.printPattern() 147 147 148 148 flips = [] … … 219 219 220 220 cl = self.pattern.contList.split('/') 221 for c in cl:222 if c: print ord(c[0]), ord(c[1]), c[2]221 # for c in cl: 222 # if c: print ord(c[0]), ord(c[1]), c[2] 223 223 ncl =[chr(f(ord(t[0]),ord(t[1]),self.pattern.sizeX-1,self.pattern.sizeY-1)[0]) +\ 224 224 chr(f(ord(t[0]),ord(t[1]),self.pattern.sizeX-1,self.pattern.sizeY-1)[1]) + t[2] + '/'\ 225 225 for t in cl if t] 226 for c in ncl:227 if c: print ord(c[0]), ord(c[1]), c[2]226 # for c in ncl: 227 # if c: print ord(c[0]), ord(c[1]), c[2] 228 228 newContList = join(ncl, '') 229 229 … … 237 237 newSizeY = self.pattern.sizeX 238 238 239 print self.pattern.sizeX, self.pattern.sizeY, newSizeX, newSizeY239 # print self.pattern.sizeX, self.pattern.sizeY, newSizeX, newSizeY 240 240 241 241 npdl = [] … … 253 253 if not pNew in l: 254 254 l.append(pNew) 255 print 'ACCEPTED'255 # print 'ACCEPTED' 256 256 if pNew == self.pattern: symmetries.append((ii,0)) 257 257 … … 279 279 if not self.fixedColor and not pNew1 in lCS: 280 280 lCS.append(pNew1) 281 print 'ACCEPTED CS'281 # print 'ACCEPTED CS' 282 282 if pNew1 == self.pattern: 283 283 if not self.fixedColor: symmetries.append((ii,1))
