| FS 05 /HOW MAKE IT: very shortly PICTORIAL GUIDE after GOMOKU ENGINE code | |||||
| go on: | < previous page
|
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 sequences of signs in accordance with this rules: Sequence have five squares and of it three square is free (N). First (1) free and last (3) free square on the same position in array "flagx" ("x_tack") must contains value 1000. Value direction must be the same like a direction searching of sequence. In the middle free square (2) must be "flagx" value (the same direction) lower than 1000.
Here is all squares combinations. Engine enhance "flagx" values in both margin of free squares (without middle).
One sample with found sequence of five squares.
|
||||
|
examples in C++
write new "flagx" values in horizontal direction: //...
//sud0 = plusx = pluso = middx = middo = 0;
//for(loop = 0; loop < 5; loop++) {
// write = column + loop;
// switch(matRCboard[row][write]) {
// case 'X': sumx += 1, xosum += 1; break;
// case 'O': sumo += 1, xosum += 1; break;
// case 'N': sud0++;
// switch(x_tack[row][write]) {
// case 0: break;
// case 1: break; //C (100) (-)
// case 10: if(sud0 == 2) middx++; plusx++; //M (1000) (-)
// case 100: if(sud0 == 2) middx++; plusx++; //MM (2000) (-)
// default: lagx += 1; //M,C (|,\,/)
//...
// } //switch(x_tack)
//...
// } //switch(matRCboard)
// } //for(loop)
//...
if((sumx == 2) && (sumx == xosum)) {
for(loop = 0; loop < 5; loop++) {
write = column + loop;
if(matRCboard[row][write] == 'N') {
switch(x_tack[row][write]) {
case 10: if((middx == 0) && (plusx == 2) && (lagx < 2)) { //M (1000) (-)
if(flagx[row][write] < 1098) flagx[row][write] = 1098;
}
//...
} //switch(x_tack)
} //if(matRCboard)
} //for(loop)
} //if
//...
|
|||||
| go on: | < previous page | next page > | |||
| FREE SECTOR, 2016 (free alliance of developers Pixoria gomoku plug-in engines) | page 5/16 | ||||