| 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 |
Recording information about "lag" value in actual sguare position with actual (from four) direction of search to new array "tack":
If "lagx" value in actual direction after editing is 5000, then to arrax "x_tack" record 100. Alike if "lagx" value is 1000 (1005), to "x_tack" record 10. And alike if "lagx" after editing is 100, to "x_tack" record 1.
For write information about direction multiply "x_tack" value with number of direction: 1 for horizontal, 2 for vertical, 3 for diagonal one ( \ ) and 4 for diagonal two ( / )
New information from next direction do not write if actual square position in array "x_tack" yet contains value (from previous directions of searching) bigger than 0.
|
||||
|
examples in C++
save information about direction (one from four) and about size (one from three) in to one number and write him to free square position (array): //direction horizontal (-) if((lagx == 5000) && (x_tack[][] == 0)) x_tack[][] = 100; if((lagx == 1000) && (x_tack[][] == 0)) x_tack[][] = 10; if((lagx == 100) && (x_tack[][] == 0)) x_tack[][] = 1; //direction vertical (|) if((lagx == 5000) && (x_tack[][] == 0)) x_tack[][] = 200; if((lagx == 1000) && (x_tack[][] == 0)) x_tack[][] = 20; if((lagx == 100) && (x_tack[][] == 0)) x_tack[][] = 2 //direction diagonal one (\) if((lagx == 5000) && (x_tack[][] == 0)) x_tack[][] = 300; if((lagx == 1000) && (x_tack[][] == 0)) x_tack[][] = 30; if((lagx == 100) && (x_tack[][] == 0)) x_tack[][] = 3 //direction diagonal two (/) if((lagx == 5000) && (x_tack[][] == 0)) x_tack[][] = 400; if((lagx == 1000) && (x_tack[][] == 0)) x_tack[][] = 40; if((lagx == 100) && (x_tack[][] == 0)) x_tack[][] = 4 |
|||||
| go on: | < previous page | next page > | |||
| FREE SECTOR, 2014 (free alliance of developers Pixoria gomoku plug-in engines) | page 17/30 | ||||