| FS 03 /HOW MAKE IT: very shortly PICTORIAL GUIDE after GOMOKU ENGINE code | |||||
| go on: | < previous page
|
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 |
If player in actual direction has not sequence minimum five squares withot his rival sign, free squares in this area on actual direction for him is without meaning. Sequence of squares between borders game area is shortly than five only in diagonals directions (in corns). For first (x) player and his sequence is border (interruption) also square with second player sign (o) and on the contrary. It alike on: see page 09 for first player:
If is uninterrupted sequence (without sign "o" or border of area) free or free and "x" signed squares shorter than five squares: for second player:
If is uninterrupted sequence squares shorter than five squares: |
||||
|
examples in C++ example no used in this engine erase values on positions in rows from left to right( >> ): for(row = 0; row < 19; row++) {
for(column = 0; column < 19; column++) {
switch(matRCboard[row][column]) {
case 'X': if(((sumo + oshift) > 1) && ((sumo + oshift) < 5)) {
for(loop = (sumo + oshift); loop > 0; loop--) {
oRCboard[row][(column - loop)] = 0;
}
}
sumx++, sumo = oshift = 0; break;
case 'O': if(((sumx + xshift) > 1) && ((sumx + xshift) < 5)) {
for (loop = (sumx + xshift); loop > 0; loop--) {
xRCboard[row][(column - loop)] = 0;
}
}
sumo++, sumx = xshift = 0; break;
case 'N': if(column == 18) { //(0 to 18) 18 = here is right border
if(((sumx + xshift) > 0) && ((sumx + xshift) < 4)) {
for(loop = (sumx + xshift); loop > -1; loop--) {
xRCboard[row][(column - loop)] = 0;
}
}
if(((sumo + oshift) > 0) && ((sumo + oshift) < 4)) {
for(loop = (sumo + oshift); loop > -1; loop--) {
oRCboard[row][(column - loop)] = 0;
}
}
}
xshift++, oshift++;
} //switch
} //for (column)
sumx = sumo = xshift = oshift = 0; //reset counters (here ending row)
} //for (row)
algorithm erase values on positions inside red borders:
|
|||||
| go on: | < previous page | next page > | |||
| FREE SECTOR, 2014 (free alliance of developers Pixoria gomoku plug-in engines) | page 6/30 | ||||