FS 05 /HOW MAKE IT: very shortly PICTORIAL GUIDE after GOMOKU ENGINE code
go on: < previous page this page 7/16LastMove /001 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.




Here is all squares combinations. Engine record LastMove position into now free array "x_plus".




One sample with found sequence of five squares.




examples in C++
search LM (in one line) in horizontal direction:
//...
//sud0 = plusx = pluso = middx = middo = 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 (|,\,/)
//...
//                         }  //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)) { //M (-)
                          if(flagx[row][write] < 1100) x_plus[row][write] = 1; //LM
                            }
//...
               }  //switch(x_tack)
         }  //if(matRCboard)
       }  //for(loop)
    }  //if
//...
go on: < previous page next page >
iM007: alike theme FREE SECTOR, 2016 (free alliance of developers Pixoria gomoku plug-in engines) page 7/16