FS 03 /HOW MAKE IT: very shortly PICTORIAL GUIDE after GOMOKU ENGINE code
go on: < previous page this page 24/30more delay 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

Choose some values from array "flagx" and write to (now free) array "x_away on the same square position other value. Search "flagx" values for dilayx and delayx structures and bigger than this.
More about bigger flagx values: see page 18
More about delay structures: see page 19 and about dilay structures: see page 20





Next step: in array "x_away" engine search structures containing more squares with value higher than zero. If yes, write new values to (now free) array "x_plus". For more about array "x_plus" see next page.




Sequences of signs in "matRCboard" array (left side) by "more delay" rules for searching values in array "x_away" (right side):

examples in C++
searching values by "more delay" rules in array "x_away" in direction from left to right ( >> ):
//erase all values in array "x_plus" ant this is now free for next use
//for(row = 0; row < 19; row++) { // for(column = 0; column < 19; column++) { // border = (19 - 1) - column; // mat = matRCboard[row][column], mat1 = matRCboard[row][(column + 1)]; // mat5 = matRCboard[row][(column + 5)], mat6 = matRCboard[row][(column + 6)]; // if(border > 3) { // for (loop = 0; loop < 5; loop++) { // write = column + loop; // switch(matRCboard[row][write]) { // case 'X': sumx++, xosum++; break; // case 'O': sumo++, xosum++; break; case 'N': lagx += x_away[row][write], lago += o_away[row][write]; if((loop == 0) && (lagx > 0)) bacx = 1; // if... // } //switch(matRCboard) // } //for(loop) if((sumx == xosum) && (sumx == 3)) sum_lagx = lagx, predictx = 5; // if... // } //if(border) // if(border > 4) { // write = column + 5; // switch(matRCboard[row][write]) { // case 'X': sumx++, xosum++; break; // case 'O': sumo++, xosum++; break; // case 'N': lagx += x_away[row][write], lago += o_away[row][write]; // if(x_away[row][write] > 0) xshift = 1; // if... // } //switch if((sumx == xosum) && (sumx == 2) && (bacx == 0) && (xshift == 0)) { if((mat == 'N') && (mat5 == 'N')) sum_lagx = lagx, predictx = 6; } // if... // } //if(border) // if(border > 5) { // write = column + 6, xshift = oshift = 0; // switch(matRCboard[row][write]) { // case 'X': sumx++, xosum++; break; // case 'O': sumo++, xosum++; break; // case 'N': lagx += x_away[row][write], lago += o_away[row][write]; // if(x_away[row][write] > 0) xshift = 1; // if... // } //switch if((sumx == xosum) && (mat1 == 'N') && (mat5 == 'N')) { if((sumx == 2) && (bacx == 0) && (xshift == 0)) { if((mat == 'N') && (mat6 == 'N') sum_lagx = lagx, predictx = 7; } if(sumx == 3) { if((xshift == 0) && (mat == 'X') && (mat6 == 'N') sum_lagx = lagx, predictx = 7; if((bacx == 0) && (mat == 'N') && (mat6 == 'X') sum_lagx = lagx, predictx = 7; } } // if... // } //if(border) // if(border > 6) { // write = column + 7, xshift = oshift = 0; // switch(matRCboard[row][write]) { // case 'X': sumx++, xosum++; break; // case 'O': sumo++, xosum++; break; // case 'N': lagx += x_away[row][write], lago += o_away[row][write]; // if(x_away[row][write] > 0) xshift = 1; // if... // } //switch if((bacx == 0) && (xshift == 0) && /*(NNNXXNNN)*/) sum_lagx = lagx, predictx = 8; if((xshift == 0) && /*(XNNXXNNN)*/) sum_lagx = lagx, predictx = 8; if((bacx == 0) && /*(NNNXXNNX)*/) sum_lagx = lagx, predictx = 8; // if... // } //if(border) // if(border > 7) { // write = column + 8, xshift = oshift = 0; // switch(matRCboard[row][write]) { // case 'X': sumx++, xosum++; break; // case 'O': sumo++, xosum++; break; // case 'N': lagx += x_away[row][write], lago += o_away[row][write]; // if(x_away[row][write] > 0) xshift = 1; // if... // } //switch if((bacx == 0) && (xshift == 0) && /*(NNXNXNXNN)*/) sum_lagx = lagx, predictx = 9; // if... // } //if(border) xshift = oshift = 0; if((sum_lagx > 0) && (sum_lagx < 1000)) { xshift = ((sum_lagx % 10) + ((sum_lagx / 10) % 10) + (sum_lagx / 100)); } //digit sum, for example 123: 1 + 2 + 3 = 6 // if...
//this code sample continue on next page
go on: < previous page next page >
FREE SECTOR, 2014 (free alliance of developers Pixoria gomoku plug-in engines) page 24/30