Changeset 174 for 06/devel/algosPY.py
- Timestamp:
- 08/16/06 22:26:22 (2 years ago)
- Files:
-
- 1 modified
-
06/devel/algosPY.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
06/devel/algosPY.py
r171 r174 1 1 # File: algosPY.py 2 2 3 ## Copyright (C) 2001- 5Ulrich Goertz (u@g0ertz.de)3 ## Copyright (C) 2001-6 Ulrich Goertz (u@g0ertz.de) 4 4 5 5 ## This file is part of Kombilo 0.6, a go database program. … … 25 25 from string import lower, join 26 26 from copy import copy, deepcopy 27 28 class AlgoError(Exception): pass 27 29 28 30 def BW2XO(c): … … 269 271 270 272 pIndex = 2*(a1%2) + (a0%2) 271 patternBits = pattern.bits[pIndex]272 273 273 274 pbIndex = 0 274 275 fpIndex = index*100 + a1/2 + (a0/2)*10 275 276 276 # print 'p', patternBits[0] 277 278 for x in range(patternBits[0]): 279 start = patternBits[pbIndex+1] 280 length = patternBits[pbIndex+2] 277 for x in range(pattern.getBits(pIndex,0)): 278 start = pattern.getBits(pIndex, pbIndex+1) 279 length = pattern.getBits(pIndex, pbIndex+2) 281 280 # print 's', pbIndex, start, length 282 281 fpIndex += start … … 284 283 for y in range(length): 285 284 pbIndex += 1 286 # print 'pbIndex', pbIndex 287 # for i in range(2): 288 # for j in range(2): 289 # if patternBits[pbIndex] & (1 << (2*(j + 2*i))): print 'X', 290 # elif patternBits[pbIndex] & (1 << (2*(j + 2*i)+1)): print 'O', 291 # else: print '.', 292 # print 293 # print 'compare with', fpIndex 294 # for i in range(2): 295 # for j in range(2): 296 # if not (self.finalpos[fpIndex] & (1 << (2*(j%2 + 2*(i%2))))): 297 # print 'X', 298 # elif not (self.finalpos[fpIndex] & (1 << (2*(j%2 + 2*(i%2))+1))): 299 # print 'O', 300 # else: print '.', 301 # print 302 # qprint fpIndex, a0, a1, x, y 303 if (patternBits[pbIndex] & self.finalpos[fpIndex]): 285 if (pattern.getBits(pIndex, pbIndex) & self.finalpos[fpIndex]): 304 286 matches = 0 305 287 break … … 666 648 hit, label, contLabelsIndex, switched =\ 667 649 patternList.updateContinuations(m[0], x, y, invco, 668 Xinterv[m], Yinterv[m], 650 Xinterv[m][0], Xinterv[m][1], 651 Yinterv[m][0], Yinterv[m][1], 669 652 dicts[m]['found'], counter, 670 continuations, contLabels,653 continuations, ''.join(contLabels), 671 654 contLabelsIndex, 672 655 db.getCurrentWinner()) … … 1550 1533 1551 1534 hit, label, contLabelsIndex, switched =\ 1552 patternList.updateContinuations(m[0], x+a0, y+a1, co, Xint , Yint,1535 patternList.updateContinuations(m[0], x+a0, y+a1, co, Xint[0], Xint[1], Yint[0], Yint[1], 1553 1536 currentUInterv.first(), counter-1, 1554 continuations, contLabels, contLabelsIndex,1537 continuations, str(contLabels), contLabelsIndex, 1555 1538 db.getCurrentWinner()) 1556 1539 if hit:
