Changeset 250 for 06/libkombilo

Show
Ignore:
Timestamp:
04/29/07 21:51:43 (2 years ago)
Author:
ug
Message:

Fixed bugs in pattern search in games with variations, and in snapshot/restore.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • 06/libkombilo/search.cpp

    r248 r250  
    15211521      movelist.push_back(ENDOFNODE); 
    15221522      movelist.push_back(0); 
    1523     } 
    1524     else { 
     1523    } else { 
    15251524      movelist[movelist.size()-2] |= ENDOFNODE; 
    15261525    } 
     1526  } else { 
     1527    movelist.push_back(ENDOFNODE); 
     1528    movelist.push_back(0); 
    15271529  } 
    15281530} 
     
    17361738    // int nodeCtr = 0; 
    17371739    // for(int i=0; i<endMovelist/2; i++) { 
    1738     //  if (movel[2*i] & BRANCHPOINT) printf("BP\n"); 
    1739     //  if (movel[2*i] & ENDOFVARIATION) printf("EV\n"); 
    1740     //  if (movel[2*i+1] & BLACK) printf("B"); 
    1741     //  if (movel[2*i+1] & WHITE) printf("W"); 
    1742     //  if (movel[2*i+1] & REMOVE) printf("C"); 
    1743     //  printf("%c", (movel[2*i] & 31)+97); 
    1744     //  printf("%c", (movel[2*i+1] & 31)+97); 
    1745     //  if (movel[2*i] & ENDOFNODE) printf("\n%d ", nodeCtr++); 
     1740      // printf(" - "); 
     1741      // if (movel[2*i] & BRANCHPOINT) printf("BP\n"); 
     1742      // if (movel[2*i] & ENDOFVARIATION) printf("EV\n"); 
     1743      // if (movel[2*i+1] & BLACK) printf("B"); 
     1744      // if (movel[2*i+1] & WHITE) printf("W"); 
     1745      // if (movel[2*i+1] & REMOVE) printf("C"); 
     1746      // printf("%c", (movel[2*i] & 31)+97); 
     1747      // printf("%c", (movel[2*i+1] & 31)+97); 
     1748      // if (movel[2*i] & ENDOFNODE) printf("\n%d ", nodeCtr++); 
    17461749    // } 
    17471750    // printf("\n"); 
     
    52605263  int rc = sqlite3_prepare(db, "select data from snapshots where rowid = ?", -1, &ppStmt, 0); 
    52615264  if (rc != SQLITE_OK || ppStmt==0) { 
    5262     printf("%d\n", rc); 
    52635265    throw DBError(); 
    52645266  } 
     
    53015303  int cl_size = snapshot.retrieve_int(); 
    53025304  for(int i=0; i<cl_size; i++) { 
    5303     currentList->push_back(make_pair(snapshot.retrieve_int(), snapshot.retrieve_int())); 
     5305    int i1 = snapshot.retrieve_int(); 
     5306    int i2 = snapshot.retrieve_int(); 
     5307 
     5308    currentList->push_back(make_pair(i1, i2)); 
     5309    // if ((*currentList)[currentList->size()-1].second >= all->size()) printf("ouch %d\n", (*currentList)[currentList->size()-1].second); 
    53045310    (*all)[(*currentList)[currentList->size()-1].second]->hits_from_snv(snapshot); 
    53055311  }