A New Family of k-in-a

A New Family of
k-in-a-row Games
I-Chen Wu and
Dei-Yen Huang
1. Introduction
„
k-in-a-row games
… Connect(m,n,k,p,q):
… Two
players alternately place p stones on an m x n
board in each turn except for that the first player
places q stones for the first move.
„
five-in-a-row(Go-Moku)
… connect(15,15,5,1,1)
„
Connect6
… connect(17,17,6,2,1)
→connect(∞,∞,6,2,1)
2. Fairness of k-in-a-row Game
„
Herik, Uiterwijk, and Rijswijck
…
„
A game is considered a fair game if it is a draw and both players
have a roughly equal probability on making a mistake.
Fairness of Connect(m,n,k,p,q)
…
They argue that p=2q is a necessary condition for fairness, in the
sense that one player always has q more stones than the other
after making each move.
… They argue that the following is a necssary condition for fairness:
the initial breakaway does not apparently favor W.
„
„
As mention later, They prove that B wins for Connect(6,2,3). This
hints that the initial breakaway does not favor W for Connect6.
Note that if B does not win for Connect(6,2,3), W can place the
initial two stones far away from the first black stone. Thus, if B goes
to defend W’s two stones, the game is just like Connect(6,2,2) with
W playing first, which favors W.
Threat-Based Strategy
„
Gomoku
… VCT:Victory
by Continuous Threes
… VCF:Victory of Continuous Four
„
Definition 1 - Threats
… For
Connect6, assume that one player, say W,
cannot connect six. B is said to have t threats,
if and only if W needs to place t stones to
prevent B from winning in B’s next move.
Threat patterns for Connect6
(a)
(b)
(c)
(a)one threat, (b)two threats, and (c)three threats
„
Algorithm to count the number of threat
… For
a line, slide a window of size six from the left
to right.
… Repeat the following step for each sliding window.
If the sliding window contains neither white stones
nor marked squares and at least four black stones,
add one more threat and mark all the empty
squares in the window.
Note that in fact we only need to mark the rightmost empty
square. The window satisfying the condition is called a
threat window.
„
„
Live-l and Dead-l threats for
Connect6
„
Definition 2 - Live-l and Dead-l threats
… In
connect6, a line includes a dead-l for one
player, say B, if B only needs to add extra 4-l
stones to create one threat. Similarly, a line
includes a live-l threat for B, if B only needs to
add extra 4-l stones to create two threats.
Live-l and Dead-l threats for Connect6
(a)
(b)
(c)
(d)
(a)live-3, (b)live-2, (c)dead-3, and (d)dead-2
The Algorithm to generate moves for Connect6
1.
2.
3.
Order all the empty squares into a list L in a descending
order according to the evaluated values.
Choose the first (best) w ones from L, (S1, S2, …, SW).
For each square Si, repeatedly do the following two
steps.
Place a stone at Si, and then order all the empty squares into a
new list Li according to the re-evaluated values.
2. Choose the first wi ones from Li, and then for each squares s in
the wi squares, put a pair of squares(si, s) into the candidate List
LC. Note that if (s, si) is already in LC, skip it.
1.
4.
Order the squares in LC according to the re-evaluated
values and choose the first w’ pairs.
The Algorithm to generate moves for Connect6
B
3
W
C D 2
A
1
W1
W2
W3
W4
3
2
F
W'pairs
Three search for generating moves for Connect6
1
E 4 G
H
Evaluate the Empty Squares
„
Evaluated Value for Attack
Attacked
Value
„
一
二
三
四
Live
125
500
1200
6000
Dead
25
100
400
2000
Evaluated Value for Defend
Defended
Value
一
二
三
四
Live
250
1800
2400
15000
Dead
50
200
800
15000
Threat-Space Search
for B
Threat-Space
Search for W
Alpha-Beta Search
Threat-Space Search
for B
A two-level tree search for Connect6.
Null-Move Heuristic
„
„
„
Opening
The basic idea is to let one player,
say W, make a null-move and
then apply the threat-space
search to finding winning
sequence of threat moves for B.
If the sequences are found, we
need to determine the relevant
zone for W to defend.
The relevant zone is called
R-Zone.
A winning sequence of B’s threat moves
after a null-move by W and R-Zone I
E
E
4
2
2
4
2
6
4
A
A
4
2
6
1
5
1
5
3
7
3
7
6
6
D
5
6
6
3
4
7
D
1
C B
2
4
Black TSS after White null move
6
2
6
5
3
A
4
4
R-Zone I
7
A
A
1
B C
2
2
The Rules to make R1-Zone
„
All black and white stones except for the initial three black stones
are in R1-Zone.
…
„
All defensive squares for the final threats are in R1-Zone.
…
…
…
„
Since it is possible for W to defend by placing a stone on any of these
squares.
For example, all As and Bs in Figure.
Note that for the single threat between two Bs in Figure. R1-Zone
includes both Bs, but not Cs for the following reason.
Since both Bs can be used to block the threat, both Bs are included. But,
since Cs cannot block the threat without the middle A, Cs does not have
to be in the zone (not that the middle A is already in the zone).
For each pair of two empty squares, if two white stones placed on
them can build a threat, the two squares are in the zone.
…
For example, Ds in Figure .However, those Es are not in the zone,
because for the upper left two 2’s we actually place one stone only and
thus two extra white stones at Es cannot build a threat.
A winning sequence of B’s threat moves
after a semi-null-move by W and
R-Zone II for 1a
„
4
4
6
1a 3
6
5
„
8
7
9
2 2
1
1 2 2
7
3
9
8
8
8
4
„
5
4
6
6
„
R-Zone II for 1a
After determining R1-Zone, for
each square in R1-Zone we
run a semi-null move process.
After all semi-null move
processes are done, L6,2,3
include all the moves that W
may defend B’s attack.
In their experiments for
Connect(6,2,3), there are 61
squares in R1-Zone, and there
are 1514 pairs in L6,2,3 .
By going through each pair, we
finally prove , B wins.
Conclusion
„
„
„
This paper introduce a new family of k-in-a-row games,
Connect(6,2,1) or Connect6 is potentially fair, based on
some arguments. Thus, Connect6 has the potentially to
become popular.
This paper proposes a thread-based strategy to play
Connect(k,p,q) games and implements a computer
program for Connect6, based on the strategy.
This paper illustrates a new null-move search approach
to solve Connect(6,2,3) with B winning. This result hints
that for Connect6 an initial breakaway does not favor W.