Changeset 215
- Timestamp:
- 02/03/07 14:07:31 (1 year ago)
- Files:
-
- 06/libkombilo/search.cpp (modified) (2 diffs)
- 06/libkombilo/testsearch.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
06/libkombilo/search.cpp
r213 r215 925 925 for(int i=0; i<6; i++) { 926 926 if (signature[2*i] == 't') next[2*i] = 't'; 927 else if (signature[2*i] == '?') next[2*i] = '?'; 927 928 else next[2*i] = Pattern::flipsX(f, signature[2*i]-'a', signature[2*i+1]-'a', boardsize-1, boardsize-1)+'a'; 928 929 if (signature[2*i+1] == 't') next[2*i+1] = 't'; 930 else if (signature[2*i+1] == '?') next[2*i+1] = '?'; 929 931 else next[2*i+1] = Pattern::flipsY(f, signature[2*i]-'a', signature[2*i+1]-'a', boardsize-1, boardsize-1)+'a'; 930 932 } … … 3763 3765 void GameList::sigsearch(char* sig) throw(DBError) { 3764 3766 if (start_sorted() == 0) { 3765 string query = "select id from algo_signature_19 where signature =? order by id";3767 string query = "select id from algo_signature_19 where signature like ? order by id"; 3766 3768 // int rc = sqlite3_exec(db, query.c_str(), sigs_callback, this, 0); 3767 3769 sqlite3_stmt *ppStmt=0; 06/libkombilo/testsearch.py
r213 r215 66 66 print 'Player %d: %s' % (i, gl.plEntry(i)) 67 67 68 for sig in ['cfcgjbbeckjc', 'aaaaaaaaaaaa', 'dfcnfmepgkjo', 'dfcn________', 'dfcn%']: 69 # SQL-wildcards are allowed: _ for a single character, % for an arbitrary number of characters 70 gl.reset() 71 gl.sigsearch(sig) 72 print gl.size(), 'games with signature', sig 68 73 gl.reset() 69 gl.sigsearch('cfcgjbbeckjc') 70 print gl.size(), 'games with signature cfcgjbbeckjc.' 71 gl.sigsearch('aaaaaaaaaaaa') 72 print gl.size(), 'games with signature aaaaaaaaaaaa.' 73 gl.reset() 74 gl.sigsearch('dfcnfmepgkjo') 75 print gl.size(), 'games with signature dfcnfmepgkjo:' 76 print gl.currentEntryAsString(0) 77 print 'signature of game 0: ', gl.getSignature(0) 74 print gl.currentEntryAsString(200) 75 print 'signature of game 200: ', gl.getSignature(200) 78 76 79 77
