| FS 03 /HOW MAKE IT: very shortly PICTORIAL GUIDE after GOMOKU ENGINE code | |||||
| go on: | < previous page
|
last page | |||
![]() game board last page 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 |
Engine "FS03" is subroutine of main program "Pixoria". Engine after her activation makes (in the rough) this: Rewrite one dimensional (1D) input array "board"[361] to two dimensional (2D) array "matRCboard"[19][19]. Count signs "N" (empty squares) in input array and detect by a ("who") is. if in input array is only signs "N", or if in input array isn't sign "O" and only one sign "X", which lay on brder of playing area: engine send to Pixoria move (dMove) to the middle game area and finished. Else continue: (basic analyse) In according with variable "who", choose strategy: rewrite either (1D) arrays "this_are_x"[34] or "this_are_o"[34] to array "x_flat"[34] or "o_flat"[34]. A/ Scan (2D) arrays and record to (2D) arrays in horizontal ( --- ) direction: a/ Scan input array "matRCboard" from left to right ( >> ) and: --- detect left and right borders of game area --- detect sequences of signs "X", "O" and "N" (see page 1) and in according with this: --- write values to arrays "xmap"[19][19] and "omap"[19][19] (see page 2, page 3, page 4 and page 5) --- write values to arrays "x_away"[19][19] and "o_away"[19][19] (see page 10) --- write values to arrays "x_plus"[19][19] and "o_plus"[19][19] (see page 8) b/ Scan input array "matRCboard" from right to left ( << ) and: --- detect right and left borders of game area --- detect sequences of signs "X", "O" and "N" (see page 1) and in according with this: --- write values to arrays "xmap"[19][19] and "omap"[19][19] (see page 2, page 3, page 4 and page 5) --- write values to arrays "x_away"[19][19] and "o_away"[19][19] (see page 10) --- write values to arrays "x_plus"[19][19] and "o_plus"[19][19] (see page 8) --- rewrite values from array "xmap" to array "xRCboard"[19][19] and from array "omap" to array "oRCboard"[19][19] c/ Scan input array "matRCboard" from right to left ( << ) and: --- detect right and left border of game area --- detect sequences of signs "X", "O" a "N" and in according with this: --- delete some values (zero) in arrays "xRCboard" and "oRCboard" (see page 6) d/ Read values in arrays: "xRCboard", "oRCboard", "xmap", "omap", "x_away", "o_away", "x_tack", "o_tack", "x_plus" and "o_plus" from left to right ( >> ) and: --- delete some values (zero) in arrays "xmap", "omap", "x_plus" and "o_plus" (see page 9) --- filter values in arrays "xmap", "omap", "xRCboard" and "oRCboard" (see page 7) --- write values to array "x_tack" and "o_tack" (see page 13, page 14, page 15, page 16 and page 17) --- edit values in arrays "xRCboard" a "oRCboard" (see page 11 and page 12) --- write values to array "flagx" and "flago" (see page 13, page 14, page 15, page 16 and page 18) --- delete contents of arrays "xmap", "omap", "x_away", "o_away", "x_plus" and "o_plus" B/ Scan (2D) arrays and record to (2D) arrays in vertical ( | ) direction: a/ Scan input array "matRCboard" from up to down and: --- farther proceed is analogical to: (A/a/) b/ Scan input array "matRCboard" from down to up and: --- farther proceed is analogical to: (A/b/), but: --- rewrite values from arrays "xmap" and "omap" to arrays "xtemporal"[19][19] and "otemporal"[19][19] c/ Scan input array "matRCboard" from down to up and: --- farther proceed is analogical to: (A/c/), but: --- delete some values (zero) in arrays "xtemporal" and "otemporal" d/ Read values in arrays: "xtemporal", "otemporal", "xmap", "omap", "x_away", "o_away", "x_tack", "o_tack", "x_plus" and "o_plus" from up to down and: --- delete some values (zero) in arrays "xmap", "omap", "x_plus" and "o_plus" --- filter values in arrays "xmap", "omap", "xtemporal" and "otemporal" --- write values to arrays "x_tack" and "o_tack" --- edit values in arrays "xtemporal" and "otemporal" --- add values to arrays "flagx" and "flago" (see page 18) --- delete contents arrays "xmap", "omap", "x_away", "o_away", "x_plus" and "o_plus" --- in according with contents arrays "xtemporal" and "otemporal" update contents arrays "xRCboard" and "oRCboard" (see page 18) --- delete contents arrays "xtemporal" and "otemporal" C/ Scan (2D) arrays and record to (2D) arrays in diagonal ( \ ) direction: a/ Scan input array "matRCboard" from left to right and from up to down and: --- farther proceed is analogical to: (A/a/) b/ Scan input array "matRCboard" from right to left and from down to up and: --- farther proceed is analogical to: (B/b/) c/ Scan input array "matRCboard" from right to left and from down to up and: --- farther proceed is analogical to: (B/c/) d/ Read values in arrays: "xtemporal", "otemporal", "xmap", "omap", "x_away", "o_away", "x_tack", "o_tack", "x_plus" and "o_plus" from left to right and from up to down and: --- farther proceed is analogical to: (B/d/) D/ Scan (2D) arrays and record to (2D) arrays in diagonal ( / ) direction: and proceed is analogical to: (C/) and continue: ("predict" sequences) E/ Scan (2D) arrays and record to (2D) arrays in horizontal ( --- ) direction: a/ Scan input array "matRCboard" and arrays "x_tack" and "o_tack" from left to right ( >> ) and: --- detect left and right border of game area --- search sequences "predict" and write values to arrays "pred_x"[19][19] and "pred_o"[19][19] (see page 21) F/ Scan (2D) arrays and record to (2D) arrays in vertical ( | ) direction: a/ Scan input array "matRCboard" and arrays "x_tack" and "o_tack" from up to down and: --- detect up and down border of game area --- search sequences "predict" and write values to arrays "xtemporal" and "otemporal" G/ Browse arrays "pred_x" and "pred_o" from left to right ( >> ) and: --- add to they values from arrays "xtemporal" and "otemporal" (see page 22) --- delete contents of arrays "xtemporal" and "otemporal" H/ Scan (2D) arrays and record to (2D) arrays in diagonal ( \ ) direction: a/ Scan input array "matRCboard" and arrays "x_tack" and "o_tack" from left to right and from down to up and: --- proceed is analogical to: (F/a/) I/ The same proceed like a in: (G/) J/ Scan (2D) arrays an record to (2D) arrays in diagonal ( / ) direction: a/ Scan input array "matRCboard" and arrays "x_tack" and "o_tack" from right to left and from up to down and: --- proceed is analogical to: (F/a/) K/ The same proceed like a in: (G/) and continue: ("delay", "dilay" and "predict" structures) L/ Scan (2D) arrays and record to (2D) arrays in horizontal ( --- ) direction: a/ Scan input array "matRCboard" and arrays "x_tack", "o_tack", "pred_x", "pred_o", "flagx" and "flago" from left to right ( >> ) and: --- detect left and right border of game area --- search structures "delay", "dilay" and "predict" (see page 19), (page 20) and (page 22) --- write values to arrays "flagx", "flago", "xtemporal", "otemporal", "xmap" and "xmap" M/ Browse arrays "xtemporal" and "otemporal" from left to right ( >> ) and: --- and according with their contents update contents of arrays "flagx" and "flago" --- delete contents of arrays "xtemporal" and "otemporal" N/ Scan (2D) arrays and record to (2D) arrays in vertical ( | ) direction: and proceed is analogical to: (L/a/) O/ The similar proceed like a in: (M/) P/ Scan (2D) arrays and record to (2D) arrays in diagonal ( \ ) direction: and proceed is analogical to: (L/a/) Q/ The same proceed like a in: (O/) R/ Scan (2D) arrays and record to (2D) arrays in diagonal ( / ) direction: and proceed is analogical to: (L/a/) S/ The same proceed like a in: (O/) --- in addition in according with contents of arrays "flagx" and "flago" write values to arrays "x_away" and "o_away" (see page 23) and continue: ("more delays" structures) T/ Scan (2D) arrays and record to (2D) arrays in horizontal ( --- ) direction: a/ Scan input array "matRCboard" and arrays "x_away" and "o_away" from left to right ( >> ) and: --- detect left and right border of game area --- search structures "more delays" and write values to arrays "x_plus" and "o_plus" (see page 24 and page 25) U/ Browse arrays "x_plus" and "o_plus" from left to right ( >> ) and: --- edit their contents V/ Scan (2D) arrays and record to (2D) arrays in vertical ( | ) direction: and proceed is analogical to: (T/a/), but write values to arrays "xtemporal" and "otemporal" W/ Browse arrays "x_plus" and "o_plus" from left to right ( >> ) and: --- edit contents of arrays "xtemporal" and "otemporal" and --- add their values to values in arrays "x_plus" and "o_plus" --- delete contents of arrays "xtemporal" and "otemporal" X/ Scan (2D) arrays and record to (2D) arrays in diagonal ( \ ) direction: and proceed is analogical to: (V/a/) Y/ The same proceed like a in: (W/) Z/ Scan (2D) arrays and record to (2D) arrays in diagonal ( / ) direction: and proceed is analogical to: (V/a/) AA/ The same proceed like a in: (W/) and continue: ("three" structures) AB/ Scan (2D) arrays and record to (2D) arrays in horizontal ( --- ) direction: a/ Scan input array "matRCboard" and arrays "flagx" and "flago" from left to right ( >> ) and: --- detect left and right border of game area --- search structures "three" and change values in arrays "flagx" and "flago" (see page 26) AC/ Scan (2D) arrays and record to (2D) arrays in vertical ( | ) direction: and proceed is analogical to: (AB/) AD/ Scan (2D) arrays and record to (2D) arrays in diagonal ( \ ) direction: and proceed is analogical to: (AB/) AE/ Scan (2D) arrays and record to (2D) arrays in diagonal ( / ) direction: and proceed is analogical to: (AB/) and continue: ("exceptions") AF/ Browse arrays "flagx", "flago", "x_plus" and "o_plus" from left to right ( >> ) and: --- search maximum values in arrays "flagx" and "flago" and save them to variables: ("max") --- search maximum values in arrays "x_plus" and "o_plus" and save them to variables: ("plus") Compare "max" variables and setup advice. AG/ Browse arrays "flagx", "flago", "x_plus" and "o_plus" from left to right ( >> ) and: --- in according with state of advice search values for exception "crossmix" in arrays "flagx" and "flago" --- if find "crossmix" change values in arrays "flagx" and "flago" (see page 27) --- in according with state of advice search values for exception "more delay use" in arrays "flagx", "flago", "x_plus" and "o_plus" --- if find "more delay use" change values in arrays "flagx" and "flago" (see page 28) and final continue: ("final" values) AH/ Browse arrays "flagx", "flago", "xmap" and "omap" from left to right ( >> ) and: --- in accoeding with values in tis and values in (1D) arrays "x_flat" and "o_flat" update values in arrays "xRCboard" and "oRCboard" (possible values: 0 to 100): (see page 29) Engine choose in according with "who" from arrays "xRCboard" and "oRCboard" one top (best) value, her position in 2D array re-count on position in 1D array and this number of position send to Pixoria like a his move dMove and finished. |
||||
| ( T H A N K S ) | |||||
| go on: | < previous page | last page | |||
| FREE SECTOR, 2014 (free alliance of developers Pixoria gomoku plug-in engines) | page 30/30 | ||||