Othello 

Example of Game Play:

This document is intended to show how Othello / Reversi is typically played.  It is not a complete game, but it should demonstrate the two major rules of placing pieces:

  1. The newly placed piece is adjacent to one of the pieces that's already on the board.  Additionally, it can't be adjacent to any piece, but instead the new piece must be adjacent to an opponent's piece.
     

  2. The newly placed piece must be able to trace at least one straight-line path (vertically, horizontally, or diagonally) over the other player's pieces to a piece that belongs to the current player, which 'brackets' the opponent's pieces.  Doing so flips (or 'reverses') all the opposing player's pieces between the two pieces.

On the right, you see an 8x8 board, with a pretty standard starting configuration.  Normally, black goes first, but this is taken care of for you by the provided code.

Note: In your code, you will need to make sure that your logic will work for any sized game board - the size is specified by the predefined variable m_Resolution.  In this case, m_Resolution is 8 - notice that since we're working with an array, the spaces are numbered starting at 0
( (0,0) being the lower-left hand corner of the board), and increasing up to m_Resolution -1.  Regardless of the size, the board will always be square (e.g., it might be 7x7, or 13x13, but it will never be 7x13).

 

7              
6              
5              
4            
3            
2              
1              
0
0 1 2 3 4 5 6 7

 

The player placing Black pieces chose to put a new piece at (3, 5) (indicated in the picture by the black piece with the 'N' in it).  This caused the white game piece at (3, 4) to flip over to black (indicated in the picture by the black piece with the 'F' in it).

Notice that by placing the piece at (3,5), the Black player satisfied both of the rules listed above - the new piece is adjacent to one of the opposing player's pieces (the Black player's new piece is adjacent to a White piece - at (3,4): see previous picture), and that there is a straight line (through the piece labeled 'F') from the new piece at (3,5) to an existing Black piece at (3,3), that crosses over at least one White piece (at (3,4)).

 

7              
6              
5            
4            
3            
2              
1              
0
0 1 2 3 4 5 6 7

 

The player placing White pieces chose to put a new piece at (4, 5) (indicated in the picture by the piece with the 'N' in it).  This caused the black game piece at (4, 4) to flip over to black (indicated in the picture by the piece with the 'F' in it)

Notice that by placing the piece at (4,5), the White player satisfied both of the rules listed above - the new piece is adjacent to one of the opposing player's pieces (the White player's new piece is adjacent to a Black piece - at (4,4): see previous picture), and that there is a straight line (through the piece labeled 'F') from the new piece at (4,5) to an existing White piece at (4,3), that crosses over at least one Black piece (at (4,4)).

 

7              
6              
5          
4            
3            
2              
1              
0
0 1 2 3 4 5 6 7

 

The player placing Black pieces chose to put a new piece at (5, 3) (indicated in the picture by the piece with the 'N' in it).  This caused the game pieces at (4, 4) and (4,3) to flip over (indicated in the picture by the pieces with the 'F' in them).

Note that in this case, by placing a single piece, two pieces have been flipped over, and that one of those pieces was on a diagonal line between the new piece and an existing piece, and another was on a horizontal line between the new piece and an existing piece.

Notice that by placing the piece at (5,3), the Black player satisfied both of the rules listed above - the new piece is adjacent to one of the opposing player's pieces (the Black player's new piece is adjacent to a White piece at (4,3): see previous picture), and that there is at least one straight line (through the piece labeled 'F') between the new piece at (5,3), and an existing Black piece at (3,3).  There is a second line between the new Black piece at (5,3) and an existing Black piece at (3,5), that crosses over a White piece at (4,4)

 

7              
6              
5          
4            
3          
2              
1              
0
0 1 2 3 4 5 6 7

 

The player placing White pieces chose to put a new piece at (4, 2) (indicated in the picture by the piece with the 'N' in it).  This caused the game pieces at (4, 4) and (4,3) to flip over (indicated in the picture by the pieces with the 'F' in them).

Note that in this case, by placing a single piece, two pieces have been flipped over.

Notice that by placing the piece at (4,2), the White player satisfied both of the rules listed above - the new piece is adjacent to one of the opposing player's pieces (the White player's new piece is adjacent to a Black piece at (4,3): see previous picture), and that there is at least one straight line (through the pieces labeled 'F') between the new piece at (4,2), and an existing White piece at (4,5), that crosses over two Black pieces at (4,4) and (4,3).

 

7              
6              
5          
4            
3          
2            
1              
0
0 1 2 3 4 5 6 7

 

At this point, the game would continue until one player is unable to make any more moves.  At that point, the game is over, and whichever player has more pieces (of their color) on the board will win the game.