| 102 | | printf("Search pattern:\n"); |
|---|
| 103 | | printf("%s\n", p.printPattern().c_str()); |
|---|
| 104 | | printf("Continuations:\n"); |
|---|
| 105 | | for(int y=0; y<p.sizeY; y++) { |
|---|
| 106 | | for(int x=0; x<p.sizeX; x++) { |
|---|
| 107 | | printf("%c", gl.lookupLabel(x,y)); |
|---|
| | 106 | // printf("Search pattern:\n"); |
|---|
| | 107 | // printf("%s\n", p.printPattern().c_str()); |
|---|
| | 108 | // printf("Continuations:\n"); |
|---|
| | 109 | // for(int y=0; y<p.sizeY; y++) { |
|---|
| | 110 | // for(int x=0; x<p.sizeX; x++) { |
|---|
| | 111 | // printf("%c", gl.lookupLabel(x,y)); |
|---|
| | 112 | // } |
|---|
| | 113 | // printf("\n"); |
|---|
| | 114 | // } |
|---|
| | 115 | // printf("\n"); |
|---|
| | 116 | // printf("Statistics:\n"); |
|---|
| | 117 | // printf("num hits: %d, num switched: %d, B wins: %d, W wins: %d\n", gl.num_hits, gl.num_switched, gl.Bwins, gl.Wwins); |
|---|
| | 118 | |
|---|
| | 119 | // printf("Continuation | Black ( B wins / W wins ) | White (B wins / W wins) |\n"); |
|---|
| | 120 | // for(int y=0; y<p.sizeY; y++) { |
|---|
| | 121 | // for(int x=0; x<p.sizeX; x++) { |
|---|
| | 122 | // if (gl.lookupLabel(x,y) != '.') { |
|---|
| | 123 | // Continuation cont = gl.lookupContinuation(x,y); |
|---|
| | 124 | // printf(" %c | %3d[%3d] ( %3d / %3d ) | %3d[%3d] ( %3d / %3d) | %1.1f / %1.1f \n", |
|---|
| | 125 | // gl.lookupLabel(x,y), cont.B, cont.tB, cont.wB, cont.lB, cont.W, cont.tW, cont.wW, cont.lW, |
|---|
| | 126 | // cont.wW*100.0/cont.W, cont.wB*100.0/cont.B); |
|---|
| | 127 | // } |
|---|
| | 128 | // } |
|---|
| | 129 | // } |
|---|
| | 130 | |
|---|
| | 131 | // ------------------- check for duplicates --------------------------------- |
|---|
| | 132 | gl.reset(); |
|---|
| | 133 | int nd = gl.find_duplicates(19); |
|---|
| | 134 | printf("duplicates:\n"); |
|---|
| | 135 | for(int i=0; i<nd; i++) { |
|---|
| | 136 | // 1st method: retrieve_duplicates_VI |
|---|
| | 137 | // vector<int> dupl_vector = gl.retrieve_duplicates_VI(i); |
|---|
| | 138 | // for(vector<int>::iterator it = dupl_vector.begin(); it != dupl_vector.end(); it++) { |
|---|
| | 139 | // printf("%s%s\n", gl.currentEntryAsString(*it).c_str(), gl.getSignature(*it).c_str()); |
|---|
| | 140 | // } |
|---|
| | 141 | |
|---|
| | 142 | // 2nd method: retrieve_duplicates_PI |
|---|
| | 143 | int * dupl_vector = gl.retrieve_duplicates_PI(i); |
|---|
| | 144 | int j = 0; |
|---|
| | 145 | while(dupl_vector[j] != -1) { |
|---|
| | 146 | printf("%s%s\n", gl.currentEntryAsString(dupl_vector[j]).c_str(), gl.getSignature(dupl_vector[j]).c_str()); |
|---|
| | 147 | j++; |
|---|
| 115 | | printf("Continuation | Black ( B wins / W wins ) | White (B wins / W wins) |\n"); |
|---|
| 116 | | for(int y=0; y<p.sizeY; y++) { |
|---|
| 117 | | for(int x=0; x<p.sizeX; x++) { |
|---|
| 118 | | if (gl.lookupLabel(x,y) != '.') { |
|---|
| 119 | | Continuation cont = gl.lookupContinuation(x,y); |
|---|
| 120 | | printf(" %c | %3d[%3d] ( %3d / %3d ) | %3d[%3d] ( %3d / %3d) | %1.1f / %1.1f \n", |
|---|
| 121 | | gl.lookupLabel(x,y), cont.B, cont.tB, cont.wB, cont.lB, cont.W, cont.tW, cont.wW, cont.lW, |
|---|
| 122 | | cont.wW*100.0/cont.W, cont.wB*100.0/cont.B); |
|---|
| 123 | | } |
|---|
| 124 | | } |
|---|
| | 151 | printf("--------------------------------------------------- \n"); |
|---|