Dots-and-Boxes Introduction

Dots-and-Boxes (a.k.a. Pigs-and-Sties) is a two player paper-and-pencil game. The players begin with a grid of dots, such as:
   +     +     +     +     +     +
                                  
                                  
                                  
   +     +     +     +     +     +
                                  
                                  
                                  
   +     +     +     +     +     +
                                  
                                  
                                  
   +     +     +     +     +     +

The players then take turns drawing vertical or horizontal lines between two adjacent dots. If a player completes one or two boxes (of size 1x1) by drawing a line, s/he places his or her initial in the box(es) and then must place one other line. His or her turn continues until s/he places a line that does not complete a box. The winner is whoever ends up with the most boxes.

For information on the Dots-and-Boxes game, see "Dots-and-Boxes for Experts" by Ian Stewart in Scientific American (v. 284, no. 1, January 2001) pp. 102-103. The article is based on The Dots-and-Boxes Game by Elwyn Berlekamp (A. K. Peters, 2000).

The following sample game is from page 4 of the book. The analysis is done using the Dots-and-Boxes Analysis Programs.

   + -3  + -3  + -3  +
                      
  -3    -3    -3    -3       The numbers indicate the result of a move
                             with best play.  Negative numbers indicate
   + -3  + -3  + -3  +       the second player to move wins.  Here, the
                             the second player can win by 3 boxes no
  -3    -3    -3    -3       matter what the first player does.
                      
   + -3  + -3  + -3  +
                             Let A be the first player and B be the
  -3    -3    -3    -3       second player.
                      
   + -3  + -3  + -3  +

                        Player A moves.

   + -1  + -3  + -1  +
                      
  -1    -1    -1    -1       Good move.  A center move gives the player B
                             the greatest opportunity to make a mistake.
   + -3  + -1  + -3  +   
                      
  -1    -1    -1    -1
                      
   + -1  #-----# -1  +
                      
  -1    -3    -3    -1
                      
   + -1  + -1  + -1  +
 
                        Player B moves.

   + -3  + -3  + -3  +
                      
  -3    -3    -3    -3       Now player B wins by 1 box with best play.
                      
   + -3  + -3  + -3  +
                      
  -3    -1    -1    -3
                      
   + -3  +-----+ -3  +
                      
  -3    -3    -3    -3
                      
   + -3  #-----# -3  +

                        Player A moves.

   + -1  + -1  + -1  +
                      
  -1    -1    -1    -1
                      
   + -1  + -3  + -1  +       Now, with exactly the right move, player
                             B wins by 3 with best play.
  -1    -1    -1    -1
                      
   #-----#-----+ -1  +
                      
  -1    -1    -1    -1
                      
   + -1  +-----+ -1  +
 
                        Player B moves.

   + -1  + -1  + -1  +
                      
  -1    -1    -1    -1       Now player B wins by 1 with best play.
                      
   + -1  + -3  + -1  +
                      
  -1    -1    -1    -3
                      
   #-----+-----+ -1  +
   |                  
   |    -5    -5    -1
   |                  
   # -5  +-----+ -1  +

                        Player A moves.


   + -1  # -1  + -1  +
         |            
  -1     |     1    -1       A good move.
         |            
   +  1  # -1  + -1  +
                      
  -1    -1    -1    -1
                      
   +-----+-----+  1  +
   |                  
   |    -1     1     1
   |                  
   +  1  +-----+  1  +

                        Player B moves.


   + -1  + -1  + -1  +
         |            
  -1     |    -1    -1       Now, player A wins by 1 with best play.
         |            
   + -1  + -1  + -1  +
                      
  -1    -1    -1    -1
                      
   +-----+-----#-----#
   |                  
   |    -5    -5     1
   |                  
   + -5  +-----+  1  +

                        Player A moves.


   +  1  +  1  +  1  +                                  + -1  + -3  + -1  +
         |                                                    |
   1     |     1     1       Now, player B can win     -1     |    -1    -1
         |                   by 1 box by immediately          |
   +  1  +  1  #-----#       giving away two boxes.     + -1  + -1  +-----+
                             Result at right with
   1     1     1     1       player A to move after    -3    -1    -3    -3
                             taking the two boxes.
   +-----+-----+-----+                                  +-----+-----+-----+
   |                                                    |     |     |
   |    -1     1     1                                  |  A  |  A  |    -1
   |                                                    |     |     |
   +  1  +-----+  1  +                                  +-----+-----+ -1  +

                        Player B moves.


   +  1  +  1  +  1  +
         |            
   1     |     1     1       Now, player A wins by 1 with best play.
         |            
   +  1  + -1  +-----+
                      
   1    -1    -3    -3
                      
   +-----+-----+-----+
   |                  
   |    -5    -5    -5
   |                  
   + -5  +-----#-----#

                        Player A moves.


   +  3  +  3  +  3  +
         |            
   3     |     3     3
         |            
   #  3  +  1  +-----+       Good move.
   |                  
   |     3     3     3
   |                  
   #-----+-----+-----+
   |                  
   |     1     1     1
   |                  
   +  1  +-----+-----+

                        Player B moves.

   +  1  +  1  +  1  +
         |            
   1     |     1     1       Good move.
         |            
   + -5  #-----#-----+
   |                  
   |    -5    -5    -5
   |                  
   +-----+-----+-----+
   |                  
   |    -5    -5    -5
   |                  
   + -5  +-----+-----+


                        Player A moves.


   #-----#  3  +  1  +
         |            
   3     |     3     1       Good move.
         |            
   +  3  +-----+-----+
   |                  
   |     3     3     3
   |                  
   +-----+-----+-----+
   |                  
   |     1     1     1
   |                  
   +  1  +-----+-----+

                        Player B moves.


   +-----+ -1  + -1  #
         |           |
  -5     |     1     |       Good move.
         |           |
   + -5  +-----+-----#
   |                  
   |    -5    -5    -5
   |                  
   +-----+-----+-----+
   |                  
   |    -5    -5    -5
   |                  
   + -5  +-----+-----+

                        Player A moves.


   +-----+  1  #  1  +
         |     |     |
   5     |     |     |
         |     |     |
   +  5  +-----#-----+       The only winning move.
   |                  
   |     5     5     5
   |                  
   +-----+-----+-----+
   |                  
   |     5     5     5
   |                  
   +  5  +-----+-----+

                        Player B moves.


   +-----#-----#  1  +
         |     |     |
   3     |  B  |     |
         |     |     |
   +  3  +-----+-----+
   |                  
   |     3     3     3
   |                  
   +-----+-----+-----+
   |                  
   |     3     3     3
   |                  
   +  3  +-----+-----+

                        Player B moves again.

   +-----+-----#-----#
         |     |     |
   1     |  B  |  B  |
         |     |     |
   +  1  +-----+-----+
   |                  
   |     1     1     1
   |                  
   +-----+-----+-----+
   |                  
   |     1     1     1
   |                  
   +  1  +-----+-----+

                        Player B moves again.

   +-----+-----+-----+
         |     |     |
  -9     |  B  |  B  |
         |     |     |
   + -9  +-----+-----+       A move like this, which gives the opponent
   |                         the option make a sacrifice, is called
   |    -9    -9    -9       a loony move.  In this situation, all of
   |                         player B's possible moves were loony.
   +-----+-----#-----+
   |           |      
   |    -3     |     1
   |           |      
   + -1  +-----#-----+

                        Player A moves.

   +-----+-----+-----+
         |     |     |
  -7     |  B  |  B  |
         |     |     |
   + -7  +-----+-----+       If player A captures the two boxes at the
   |                         lower left he must then give up the other
   |    -7    -7    -7       4 boxes.  By instead making a sacrifice,
   |                         player A wins.
   +-----+-----+-----#
   |           |     |
   |    -3     |  A  |
   |           |     |
   +  1  +-----+-----#

                        Player A moves again.

   +-----+-----+-----+
         |     |     |
   5     |  B  |  B  |
         |     |     |
   +  5  +-----+-----+
   |                    
   |     5     5     5  
   |                    
   +-----+-----+-----+
   |           |     |
   |     1     |  A  |
   |           |     |
   #-----#-----+-----+

                        Player B moves.

   +-----+-----+-----+
         |     |     |
   1     |  B  |  B  |
         |     |     |
   +  1  +-----+-----+
   |                  
   |     1     1     1
   |                  
   +-----#-----+-----+
   |     |     |     |
   |  B  |  B  |  A  |
   |     |     |     |
   +-----#-----+-----+

                        Player B moves again giving up the remaining boxes.

<- Parent Directory

David Wilson / dwilson@cae.wisc.edu