Ken's Puzzle of the Week

Coloring a Chessboard

Starting with an ordinary 8x8 chessboard, perform a series of shifts to move all the black and white squares into contiguous colors.  A "shift" is a push of one row (A-H) from left to right, or one column (1-8) from top to bottom.  When a row is shifted right, the square shifted out is moved to the far left to keep the 8x8 square.  Similarly, for a column shift, the square shifted out is moved to the top.

What is the fewest number of shifts needed to make all the black squares be contiguous and all the white squares be contiguous?  What is the fewest number of shifts needed to just make a contiguous group of black squares?

Source: Original.


Solutions were received from Kirk Bresniker, Dan Chirica, and Joseph DeVincentis.  Kirk sent the following:

The answer is the same: 7 moves are required to create a contiguous region of one color, but that is also the number required to make both regions contiguous.
If we start with a board numbered like this:
  01234567
A 01010101
B 10101010
C 01010101
D 10101010
E 01010101
F 10101010
G 01010101
H 10101010
The following pattern of moves yield both contiguous areas of 1 and 0:
2C4E6AG

  01234567
A 11111110
B 10001010
C 11101010
D 10000010
E 11111010
F 10000000
G 11111110
H 10000000
Another nice permutation of the above moves is:
246ACEG

  01234567
A 11111110
B 10000000
C 11111110
D 10000000
E 11111110
F 10000000
G 11111110
H 10000000
No set of 6 moves creates a contiguous region. Note: I did my moves up and left instead of down and right, but the answer should be the same.
Mail to Ken