![]() |
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) or last (3) free square on the same position in array "flagx" ("x_tack") must contains value 1000. Direction of value must be the same like a direction searching of sequence. At least one from next free squares must contains "flagx" value 100 in the different direction than direction of sequence. ![]() Here is all squares combinations. Engine rewrite values in "flagx" array from 1000 to 1098. ![]() One sample with found sequence of five squares. ![]() |
||||
examples in C++
write new "flagx" values in horizontal direction: //... //sud0 = plusx = pluso = middx = middo = liftx = lifto = 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 (|,\,/) // if((x_tack[row][write] > 9) liftx++; //... // } //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 == 1) && (lagx > 0) && (lift == 0)) { 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 6/16 | |||