Implement a program to play the game of Konane, also known as Hawaiian Checkers. You may work in teams of two or three on this lab. We will play the game on an 8 by 8 board of light and dark pieces as shown below (using X for dark and O for light).
0 1 2 3 4 5 6 7 0 X O X O X O X O 1 O X O X O X O X 2 X O X O X O X O 3 O X O X O X O X 4 X O X O X O X O 5 O X O X O X O X 6 X O X O X O X O 7 O X O X O X O X
First, the dark player removes a dark piece either at position (0, 0), (7, 7), (3, 3), or (4, 4). Next the light player removes a piece adjacent to the space created by the first move. Then the players alternate moves, each jumping one of his/her own pieces over one horizontally or vertically adjacent opponent's piece, landing in a space on the other side, and removing the jumped piece. If desired, this may be continued in a multiple move, as long as the same piece is moved in a straight line. The game ends when one player can no longer move and that player is considered the loser.
Try playing against Aaron Carlisle's Konane game from the 2000 AI class to get a better sense of how the game is played.
Thanks to much hard work by Erik Osheim, with help from Tia Newhall, Sean Finney and Daniel Sproul, we now have an arbiter program to help us run the tournament. To get a copy of the arbiter do the following:
/home/meeden/Public/cs63/lab5-konaneThe arbiter expects to receive two executable programs as arguments. The first one provided will go first and will play X, the second one will play O. Your executable must not take any arguments. To run the arbiter do the following:
./arbiter dumb smarterYou will be able to see the game in progress and a log file will be created showing the entire game.
col1 row1 col2 row2
(col1, row1)
to the
final position (col2, row2)
.
-1 -1 -1 -1
col1 row1 col1 row1
(col1, row1)
. Your program
has been designated to go second and needs to make a valid response.
-100 -100 -100 -100
-50 -50 -50 -50
(col1 row1) (col2 row2)\0
(col1, row1)
to the final position (col2, row2)
. Notice that the
output is terminated by the null character.
(-100 -100) (-100 -100)\0
printf
line, you should call
fflush(stdout);
.