I am trying to find out if there are any 'optimal' moves in the game, so as to trap my enemy to put his pawns in the place where I need them
-
2$\begingroup$ Connect Four is a solved game. The first player can force a win by going in the middle column. Wikipedia describes it in en.wikipedia.org/wiki/Connect_Four#Mathematical_solution. $\endgroup$– Kendall FreyJun 3, 2014 at 11:31
-
1$\begingroup$ As a heads-up, I've flagged this for a suggested move; this question would likely be a better fit for boardgames.SE rather than puzzling.SE, since it concerns a game rather than a puzzle. $\endgroup$– Steven StadnickiJun 4, 2014 at 0:38
3 Answers
forcing only happens when you can either make a 4 in a row next turn (forcing him to put his piece there to remain in the game) or
a 2 in a row with 2 spots one way and 1 spot the other:
2 1 B B 2
you could place a piece in 1
while the 2
s are free then you have a guaranteed win, he needs to place in any of the free spots to be able to block you
In addition to @ratchetfreak's answer, it is possible to indirectly force a move in another way: when you can place a piece on your next turn such that there are multiple slots on which you can win (branching). This is a generalization of the "two free slots" case presented in his answer.
For example,
x
oxx
oxox
If x moves on row 2 (counting from the left), he is guaranteed a win on the subsequent turn; therefore, o must place a piece to block this branching first.
A more complex example of this could be multi-stage branching, which could look something like this:
oxoxo
oxxxo
o is forced to move in one of rows 1-5 in order to avoid losing; try playing it out to see why. (Needless to say, this would be very rare in a real game, but it's theoretically possible.)
-
$\begingroup$ In your second scenario, if
o
plays6
or7
, then the game will go2 2 4 4 3
and then either1 5
or5 1
wins the game forx
. $\endgroup$– user88Jun 4, 2014 at 2:00
In addition to the answers above, another key concept for Connect-4 is the notion of Zugzwang: having to make a move that one doesn't want to. Often parity is a way to force this; eventually a player is forced to play in a column that they don't want to. A very simple example of this concept is the following structure:
x
xo
oo
__xx
Suppose it's X's turn to move here (the underscores represent an empty column). Then X can force a win by playing on the left hand side:
x
xo
oo
x_xx
Now, o has to move into the second column to block the four-across - but doing so lets x win on the diagonal instead, by playing above o's piece. This particular configuration is obviously highly contrived - but 'locking' columns so that it's suicidal for one player to play there is often easier than it might seen; once that's done, it becomes a question of leaving that player with no other good moves.
-
3$\begingroup$ Your point is a valid one, but this is not zugzwang, it's a double threat. If player A were in zugzwang, that would mean A has the move, and would be able to get a better result if he were allowed to pass this turn, than the best he can actually get. Here, if o were allowed to pass, x could still win along the row. $\endgroup$– Rosie FJul 29, 2016 at 11:53