CCC '06 J5 - CCC Othello
| Board at the beginning of the game | Board after the black player has placed a disc in row \(5\) and column \(6\) |
|---|---|
![]() |
![]() |
| Board after several plays by each player | Board after the white player has placed a disc in row \(4\) and column \(6\) |
![]() |
![]() |
| Board after several plays by each player | Board after the white player has placed a disc in row \(1\) and column \(4\) |
![]() |
![]() |
In the CCC version of Othello, the board may start with one of \(3\) configurations. Play will always start with the black player taking the first turn, and then alternating white to black for the rest of the turns. You must write a program to simulate taking turns in an Othello game, and at the end, report how many pieces of each colour are on the board.
Input Specification
The user will enter three components of input (via the keyboard).
First, the user will enter a letter representing the configuration of the initial board (either a , b or c ).
Here are the initial configurations for the board.
| Configuration a | Configuration b | Configuration c |
|---|---|---|
![]() |
![]() |
![]() |
The second component of input will be an integer \(N\) , where \(0 \le N \le 30\) which indicates the number of moves to be made in the simulation. The third component of input is \(N\) pairs of integers \(R\) , \(C\) where \(1 \le R \le 8\) and \(1 \le C \le 8\) , and \(R\) represents the row and \(C\) represents the column of the next move.
Remember that the first move will be made by the black player, the next move will be made by the white player, then the black player, then the white player, and so on. You may also assume that all moves \((R, C)\) will be valid moves on empty spaces on the board.
Output Specification
The program will output the number of black discs showing followed by the number of white discs showing on the board after the moves have been made. You are not responsible for displaying a picture of the board during the game. However, during your own testing, this may be useful.
Sample Input 1
a 1 5 6Sample Output 1
4 1Sample Input 2
b 0Sample Output 2
8 8Sample Input 3
c 3 1 7 2 2 2 1Sample Output 3
22 13








Comments