HOW IT WORKS - BRIEF GUIDE TO THIS ENGINE
obsah: delay rules: page 10/12

inputs and outputs
first moves
basic analysis
RCboard rules
first 2 layers
flag rules (1D)
flag combination (2D)
LM moves
three structure
delay rules
last analysis

summary

go to page:
pixoria main


The engine looks for such series of opponent's forced moves, by which it could also create its winning sequence. Series of moves that could be forced by the opponent to achieve the opposite, must on the other hand be blocked in time. For this, it needs information from arrays delay and matRCboard.
When the engine looked for character sequences according to flag rules and found a free square in one of the four directions (horizontal, vertical, two diagonal) marked in flag rules with letter
M (1000) or CI (101), it also marked it in the delay array. To that, it added the info about line orientation, in which the square was found.
So now the engine searches arrays 'delay' and 'matRCboard' for sequences composed of various combinations of
N, X, M and CI ( N, O, M and CI ). First it searches the horizontal lines forward and back, then verical etc. So gradually in all 4 orientations and 8 directions. During that search, M and CI must not have an orientation matching the currently searched line.

The data in delay arrays is encoded this way: the flag character value (M = 1, CI = 10) times orientation (horizontal = 1, vertical = 2, first diagonal = 3, second diagonal = 4). E.g. number 30 found somewhere in array delayx means: this free square satisfied the flag rules when searching matRCboard array, valued CI and in a line oriented as first diagonal (30 = 10 * 3 - that corresponds to CI and 1st diagonal).

So if the engine finds itself at an empty square, it tests the surroundings before and after the square, in the search line, according to delay rules. Also each of the six rules has its strong and weak variety. The varieties of a given rule differ by a ration of M to CI . M has more weight for forcing a move than CI, which is why stronger varieties of delay rules have a higher ration of M to CI. There are many combinations N, X, M, CI ( N, O, M, CI ), that match all delay rules.

click here for view delay rule 01
click here for view delay rule 02
click here for view delay rule 03
click here for view delay rule 04
click here for view delay rule 05
click here for view delay rule 06

priklad: image 011:

The engine is player one ( X ) and should take its turn. In the first diagonal, it ound a character combination that matches the stronger variant of delay rule 04. In array xRCboard it will therefore update move values in corresponding positions:
... xRCboard[row][column] = diifx; ( 47 )

image 012:

By a delay move (15) it will force the second player to move (16) and at the same time the first player creates an MCI combination (flagx). By a next move in this place (17) it forces the opponent to move (18). Now the engine is only two simple moves away from victory.

Position of delay move 'diif' (strong variety) and 'dif' (weak variety) in move hierarchy:
image 013:


click here for view final hiearchy if engine is first ( X ) player
click here for view final hiearchy if engine is second ( O ) player

But the position of 'diif' in the hierarchy depends also on current game state. Before the engine begins to look for sequences according to delay rules, it checks its situation: determines the values of current best moves for both players (maxRCx a maxRCo ). When the value of its own best move is lower than value of opponent's best move, and that one is lower than max. possible (50) value and also higher than value of delay move (diif) for the engine, the engine will increase the value of its diif move so that it's exactly as much as the value of opponent's best move (example: diifx = maxRCo).
Simply put, it tries to keep the initiative (to attack) and avert an imminent defeat that way. This can succeed only if it then finds one of its own delay sequences.

In positions matching the strong (diif) variants of delay rules, the engine adds 1 into the respective player's array(xDilay, oDilay). Further positions from other lines are added up.




go top independent Machines develop lab (2013) page 10/12