Changeset 150

Show
Ignore:
Timestamp:
04/12/04 18:22:55 (5 years ago)
Author:
ug
Message:

Fix whereAreWe in Algo_movelist

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • 06/devel/algosPY.py

    r148 r150  
    605605                    whereAreWeCopy = copy(whereAreWe) 
    606606                    if movelistIndex < self.posTable[index]+4 or not movelist[movelistIndex-2] & ENDOFVARIATION: 
    607                         whereAreWe[-1] -= 1 
    608                         whereAreWeCopy.extend([0,-1]) 
     607                        # whereAreWe[-1] -= 1 
     608                        # print 'X', counter 
     609                        whereAreWeCopy[-1] -= 1 
     610                        whereAreWeCopy.extend([0,0]) 
    609611                    self.branchpoints.append((deepcopy(dicts), deepcopy(dictsNO), 
    610612                                              deepcopy(contList), deepcopy(contListIndex), counter, 
     
    619621                                if patternList.get(m[0]).colorSwitch and showColorSwap: 
    620622                                    if searchInVariations: 
    621                                         result.append(Hit(dicts[m]['found'], '-', copy(whereAreWe))) 
     623                                        result.append(Hit(dicts[m]['found'], '-', dicts[m]['whereAreWe'])) 
    622624                                    else: result.append(Hit(dicts[m]['found'], '-')) 
    623625                                else: 
    624626                                    if searchInVariations: 
    625                                         result.append(Hit(dicts[m]['found'], '', copy(whereAreWe))) 
     627                                        result.append(Hit(dicts[m]['found'], '', dicts[m]['whereAreWe'])) 
    626628                                    else: result.append(Hit(dicts[m]['found'], '')) 
    627629                    dicts, dictsNO, contList, contListIndex, counter, whereAreWe = self.branchpoints.pop() 
    628630                     
    629631                    whereAreWe[-2] += 1 
     632                    # print 'Y' 
    630633                    # assert whereAreWe[-1] == 0 
    631634                         
     
    668671                                    # FIXME: CHECK,was: (patternList[m[0]].colorSwitch or colorSwitch) and showColorSwap: 
    669672                                    if searchInVariations: 
    670                                         result.append(Hit(dicts[m]['found'], label+'-', copy(whereAreWe))) 
     673                                        result.append(Hit(dicts[m]['found'], label+'-', dicts[m]['whereAreWe'])) 
    671674                                    else: result.append(Hit(dicts[m]['found'], label+'-')) 
    672675                                else: 
    673676                                    if searchInVariations: 
    674                                         result.append(Hit(dicts[m]['found'], label, copy(whereAreWe))) 
     677                                        result.append(Hit(dicts[m]['found'], label, dicts[m]['whereAreWe'])) 
    675678                                    else: result.append(Hit(dicts[m]['found'], label)) 
    676679                                del dicts[m] 
     
    684687                                    if contListIndex[m] == len(contList[m]): 
    685688                                        dicts[m]['found'] = counter 
     689                                        dicts[m]['whereAreWe'] = copy(whereAreWe) 
     690                                        print 'found', counter, whereAreWe 
    686691                                        del dicts[m]['foundInitial'] 
    687692                                else: 
     
    771776                        if dictsNO[m] == 0 and not dicts[m].has_key('found') \ 
    772777                           and not dicts[m].has_key('foundInitial'): 
    773                             if contListIndex[m] == len(contList[m]): dicts[m]['found'] = counter 
     778                            if contListIndex[m] == len(contList[m]): 
     779                                dicts[m]['found'] = counter 
     780                                dicts[m]['whereAreWe'] = copy(whereAreWe) 
     781                                print 'found1', counter, whereAreWe 
    774782                            else: dicts[m]['foundInitial'] = counter 
    775783 
     
    788796                        if patternList.get(m[0]).colorSwitch and showColorSwap: 
    789797                            if searchInVariations: 
    790                                 result.append(Hit(dicts[m]['found'], '-', copy(whereAreWe))) 
     798                                result.append(Hit(dicts[m]['found'], '-', dicts[m]['whereAreWe'])) 
    791799                            else: 
    792800                                result.append(Hit(dicts[m]['found'], '-')) 
    793801                        else: 
    794802                            if searchInVariations: 
    795                                 result.append(Hit(dicts[m]['found'], '', copy(whereAreWe))) 
     803                                result.append(Hit(dicts[m]['found'], '', dicts[m]['whereAreWe'])) 
    796804                            else: 
    797805                                result.append(Hit(dicts[m]['found'], ''))