Mancala 2003

Due: January 23 11:59AM

Objective: Design and program a computer player for the game of Mancala2003. Your final product will be entered into the class tournament to determine your grade on the project (see below for more information on the tournament format).

Teamwork:You can work in teams of two for this program, although if you prefer you can work alone. Each individual in the class is allowed to enter one program that will be identified by their username followed by the name of the program. Thus if kinley and smith were a group, we would be allowed to submit kinley-mancala.ss and smith-mancala.ss. They could be identical programs or substantially different. This will enable groups to explore different ways of constructing their computer AI.

The Game: The game is a variant of the traditional African game Mancala. I have written a description of the rules and play of this game. If you have additional questions, please address them on the newsgroup.

http://www.rose-hulman.edu/Class/cs/cs413/www/assignments/mancala-rules.html

�These rules are set in stone for the duration of the competition. However, if ambiguities are detected, I will make updates until Jan 17th.

The program:

You are only required to implement a single function for this assignment (although it is certain you will need to write many more of your own choosing).The function must be called username-getmove and will take the current state of the board, and which player is making the next move (i.e. your program).

Every function that your write in this program should be prefaced by your username followed by a hyphen. For example, in my version of the game, I would call the above function kinley-getmove(board,player). Any program having functions not conforming to this convention automatically forfeits all games in the tournament and receives the lowest possible score.The file you store your game in should again make use of this convention, thus my file would be called kinley-mancala.ss

You are allowed to refer to player numbers however you desire (I use players 0 and 1) but to ensure consistency with your program you must define two global variables in your program *username-firstPlayer* and *username-secondPlayer* and assign them appropriate values based on your view of the two players. I assume *username-firstPlayer* is always the player who goes first.

The board must be represented as follows:

����������������(0    ; the number of stones in player 0

                  0     ; the number of stones in player 1 has captured

               ((8 8 8 8 8 8 8 8) ; represents the initial state for player 0

                (8 8 8 8 8 8 8 8))) ; represents the initial state for player 1

The board state is laid out exactly how it is viewed from an overhead perspective with Player 0 on the top. Thus the positions correspond to

((a b c d e f g h)

  (h g f e d c b a))

You are of course allowed to change the representation as you need.

A call to getmove passes the current board state and the player who is to make the next move.

(getmove �(0 0 ((8 8 8 8 8 8 8 8 ) (8 8 8 8 8 8 8 8)) *player-number*)

Important: You should return a move in the following form from your getmove function

You may use any techniques you desire to augment the intelligence of your system.

The tournament rules:

The tournament will be conducted in world cup style. Each program will be assigned to a group of 4 or 5 programs. Each group will be put through a round robin tournament with the winner of the group advancing to the second round. At least 16 programs will advance to a second winners tournament round where they will be seeded based on their performance in the initial round. At-Large teams may be used to augment the second round field. All ties will be first broken by head to head records, next by records against the player who finished next highest in the bracket and so on.

A referee program will run the tournament by loading each opponents program and asking each program for its move based on the current board state. Each player will be given approximately 1 minute per turn. If a player fails to make a move in the allotted time then the player forfeits the match regardless of the current score. However, if the player has not responded within the minute there is a last chance mechanism. The referee will ask for username-getfinalmove with the same parameters as getmove but allowing only one second for a response. If a player�s program performs an error than the player forfeits the match.The referee has been tested extensively and thus has final say on all decisions related to the game. However, any errors found in the referee program and reported will be appreciated. I will run the tournament on multiple different machines so no assumptions should be made about the speed of the machine or the load of a given machine. All you can assume is that I will provide I minute of cpu time to each program, and I will use the same machine for both.

Programs must be turned in by January 23rd at noon. The first round will be conducted over the next two days with finalists announced Friday evening. Players advancing to the second round may modify and tweak their programs anytime up until the final round begins at 7:00PM on January 27th.The championship match will be performed in class.There will likely be a loser�s bracket as well/.

Grading:

The program is grade based on its performance in the tournament. In the case of teams, the better program will be scored.

Disclaimer:

Andy is allowed to augment and modify this document through Jan 17th. However, there will be no changes that radically alter how the programs must be written.