FS 03 /HOW MAKE IT: very shortly PICTORIAL GUIDE after GOMOKU ENGINE code
go on: < previous page this page 26/30three next page >


game board
summary

sumx and sumo
sumx to xmap
xmap between x add
xmap between x less
xmap more samples
zeroX and zeroO
xmap editing
x_plus and middx
x_plus and zeroX
x_away and o_away
xRCboard and liftx
xRCboard add & less
xmap to lagx
lagx 5000 & x_away
lagx 100 & x_away
lagx 10 and lagx 1
lagx to x_tack
xRCboard allways
flagx allways

delayx
dilayx
pred_x
pred_x to xmap
choose from flagx
more delay
more delay samples
three
crossmix
more delay use
flag to RCboard

summary

"Three" is symmetrical structure with two free squares on his both ends, which contains in arrays "flag" values 5000(D). Others structures, which contains only one D is not "three".




Engine "three" uses for defence. Add to "three's" D squares "flag" values from near by free squares. Don't add "flag" values from the same direction with actual "three" structure (>> M).
In this sample are engine first player (X) and is on move. Without "three" have both D squares the same priority. With "three" have higher priority D square on left side because this "flago" value is now 5100.





If in the near by free square is "delay" (1098) or "dilay" (1097) "flag" value , add this value to near by D wholly.
In this sample add to D "delay" value 1098. Value in left D square is now 6098.


examples in C++
saearch "three" in horizontal direction ( >> ) and add "flgx" values from near by squares:
//int xoflag[4] = {0, 100, 1000, 5000};
//for(row = 0; row < rcmax; row++) { // for(column = 0; column < rcmax; column++) { // border = (19 - 1) - column, mat = matRCboard[row][column],; // mat1 = matRCboard[row][(column + 1)], mat2 = matRCboard[row][(column + 2)]; // mat3 = matRCboard[row][(column + 3)], mat4 = matRCboard[row][(column + 4)]; // mat5 = matRCboard[row][(column + 5)], mat6 = matRCboard[row][(column + 6)]; if((border > 5) && (mat == 'N') && (mat1 == 'N') && (mat5 == 'N') && (mat6 == 'N')) { if((mat2 == 'X') && (mat3 == 'X') && (mat4 == 'X')) { scoop = xoflag[2]; if((flagx[row][column] > 1096) && (flagx[row][column] < 1100)) scoop = 0; loop = flagx[row][column] - scoop; flagx[row][(column +1)] += loop; scoop = xoflag[2]; if((flagx[row][(column + 6)] > 1096) && (flagx[row][(column + 6)] < 1100)) { scoop = 0; } loop = flagx[row][(column + 6)] - scoop; flagx[row][(column + 5)] += loop; threex++; //counter // } // if... // } // } //}
go on: < previous page next page >
iM007: alike theme FREE SECTOR, 2014 (free alliance of developers Pixoria gomoku plug-in engines) page 26/30