FS 05 /HOW MAKE IT: very shortly PICTORIAL GUIDE after GOMOKU ENGINE code | |||||
go on: | < previous page this page 4/16M+ in line /002 | next page > | |||
game board summary flagx add ten flagx values M+ in line /001 M+ in line /002 M+ in line /003 M+ in line /004 LastMove /001 LastMove /002 predict low now predict high now 2d delay, dilay more delay now dilay +, delay + three: better end strategy FS05 summary |
Engine search this six sequences, combination signs N and X, or combination signs N and O. (previous page). But engine accept also no complete sequences. In sequence instead signs X (or O) can be square with N sign. That square but must in array "flagx" ("flago") contain value higher than 99. And this value must be from different direction than search sequence direction. Information about "flagx" direction of values contains array "x_tack". Value in array "flagx" can be also sum from different directions. More about arrays with directions: see pages FS03 (17) In this sample engine found one sequence with two missing signs X. Values in array "flagx" on positions with missing X signs engine change: |
||||
examples in C++
write new "flagx" values in horizontal direction: //int mplus1[7] = {1, 0, 1, 0, 1, 0, 1}; //x-x-x-x (o-o-o-o) //... //lag = 7; //x-x-x-x //for(loop = 0; loop < lag; loop++) { // write = column + loop; // switch(matRCboard[row][write]) { // case 'X': sumx += 10, xosum += 10, xmplus[loop] = 100; break; // case 'O': sumo += 10, xosum += 10, omplus[loop] = 100; break; // case 'N': switch(x_tack[row][write]) { // case 0: xmplus[loop] = 0; break; //flagx < 100 // case 400: xmplus[loop] = 10; break; //flagx(/) = 2000 // case 300: xmplus[loop] = 10; break; //flagx(\) = 2000 // case 200: xmplus[loop] = 10; break; //flagx(|) = 2000 // case 40: xmplus[loop] = 10; break; //flagx(/) = 1000 // case 30: xmplus[loop] = 10; break; //flagx(\) = 1000 // case 20: xmplus[loop] = 10; break; //flagx(|) = 1000 // case 4: xmplus[loop] = 1; break; //flagx(/) = 100 // case 3: xmplus[loop] = 1; break; //flagx(\) = 100 // case 2: xmplus[loop] = 1; break; //flagx(|) = 100 //... // } //switch(x_tack) //... // } //switch(matRCboard) //... //(compare mplus1[loop] and xmplus[loop]) //... // } //for(loop, lag) //... //if((xshift > 0) { //xshif = 7 (x-x-x-x) // for(loop = 0; loop < xshift; loop++) { // if(xmplus[loop] < 100) lagx += xmplus[loop]; // } //for(loop) // if(lagx > 0) { // for((loop = 0; loop < xshift; loop++) { //xshif = 7 (x-x-x-x) // write = column + loop; if((lagx > 1) && (lagx < 10) && (xmplus[loop] == 1)) { if(flagx[row][write] < 197) flagx[row][write] = 197; } if((lagx == 1) && (xmplus[loop] == 1)) { if(flagx[row][write] < 198) flagx[row][write] = 198; } if((lagx > 10) && ((lagx % 10) > 0) && (xmplus[loop] == 10)) { if(flagx[row][write] < 1097) flagx[row][write] = 1097; } if((lagx == 10) && (xmplus[loop] == 10)) { if(flagx[row][write] < 1098) flagx[row][write] = 1098; } if((lagx > 10) && ((lagx % 10) == 0) && (xmplus[loop] == 10)) { if(flagx[row][write] < 1098) flagx[row][write] = 1098; } // } //for(loop) // } //if(lagx) // } //if(xshift) //... |
|||||
go on: | < previous page | next page > | |||
FREE SECTOR, 2016 (free alliance of developers Pixoria gomoku plug-in engines) | page 4/16 | ||||