FS 05 /HOW MAKE IT: very shortly PICTORIAL GUIDE after GOMOKU ENGINE code | |||||
go on: | < previous page this page 1/16flagx add ten | 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 |
Square positions near board border or near positions of rival is inconvenient. Higher value in array "x_away" indicate for first player (X) lower advantage. More about "away" arrays: see pages FS03 (10) Higher value in array "xRCboard" indicate better position for player X. In this situations on this positions engine insert to array "xRCboard" values zero. More about "RCboard" arrays: see pages FS03 (07) Value zero is automaticaly (over variable "lag") insert to other array "flagx". Engine use this algorithm: if sequence of five squares contains two squares X and three squares N, then to array "flagx" record on positions with N value 10 (if original value are lower than 10). New values (10) in array "flagx" engine edit in accordance with values in array "x_away". Final value in edit square determine variable "tiffx". Here are it zero. Here are final edit value in array "flagx" one ("tiffx" = 1). |
||||
examples in C++
erase value if... //for (row = 0; row < rcmax; row++) { //for (column = 0; column < rcmax; column++) { // ... //o., ox., oxx., (o-x-x-o, o-xx--o): if((lagx == 100) && (x_away[row][column] > 3)) lagx = 0; if((bacx == 0) && (lagx < 100) && (x_away[row][column] > 3)) xRCboard[row][column] = 0; //x., xo., xoo., (x-o-o-x, x-oo--x): if((lago == 100) && (o_away[row][column] > 3)) lago = 0; if((baco == 0) && (lago < 100) && (o_away[row][column] > 3)) oRCboard[row][column] = 0; // ... // } // } edit (change values in) arrays "flagx" and "flago": //keepx = 10; //keepo = 10; //tiffx = 1; //tiffo = 1; //sumx = sumo = 0; //for (row = 0; row < rcmax; row++) { //for (column = 0; column < rcmax; column++) { // ... for (loop = 0; loop < 5; loop++) { write = column + loop; switch(matRCboard[row][write]) { case 'X': sumx++; break; case 'O': sumo++; break; } } // ... if((sumx == 2) && (sumo == 0)) { for (loop = 0; loop < 5; loop++) { write = column + loop; if((matRCboard[row][write] == 'N') && (flagx[row][write] < keepx)) { flagx[row][write] = keepx; } } // ... if((keepx > 0) && (keepx > tiffx) && (flagx[row][column] == keepx)) { if(x_away[row][column] > 3) flagx[row][column] = tiffx; } // ... // } // } |
|||||
go on: | < previous page | next page > | |||
FS03: alike theme | FREE SECTOR, 2016 (free alliance of developers Pixoria gomoku plug-in engines) | page 1/16 | |||