Fanorana - AI Game Project for 2009

Tournament Results

  1. Hotpocket: 8 wins, 0 ties, 0 losses
  2. Asimov: 5 wins, 0 ties, 3 losses
  3. FOO: 3 wins, 2 ties, 3 losses
  4. Fan-Whats-its: 2 wins, 1 tie, 5 losses
  5. Synergy: 0 wins, 1 tie, 7 losses

The undisputed champion is HOTPOCKET followed by ASIMOV for second place. Thanks for all the teams putting in the effort to compete in the tournament.


For this course, your project is to write an AI program that can play the game Fanorona, which is the national game of Madagascar and has its roots in a 3000 year old game. Your program will have up to 20 seconds to make its move (amount of time subject to change). At the end of class there will be a tournament among the AI programs, and the team (or individual) with the winning program wins extra credit points worth half a letter grade.

For rules on how to play see Shorter rules are available at Boardspace. An online applet is also available from the Boardspace home page.

We will be playing the tournament in the CS lab so you must make sure that your programs run there. To be fair in terms of processing power, you may not execute code on remote machines.

Tournament Format

Every team will play every other team twice, once where each team goes first. The total number of wins will determine the ranking. If there is a tie in number of wins then if one team beat the other directly either 2-0-0 or 1-0-1 then the winning team will place ahead of the losing team. If there is still a tie, your instructor will conduct a to-be-determined tiebreaker or declare a draw. Note that the game manager will declare a draw if the same moves repeat 3 times.

Game Manager

To speed up tournament play, I have tasked a CS A401 team to write a game manager. The manager is an intermediary program that displays the game board and allows two client AI programs to connect to it via TCP sockets. Each client will send their moves to the manager. In this fashion, the tournament can be completely automated instead of requiring humans to type in each move. By utilizing TCP, clients may also be written in different languages.

NEW - GAME MANAGER. The much anticipated game manager written by the CS 401 team is here: Fanorona Game Master Downloads. The current version is a Release Candidate 2. Run the jar using java with : "java -jar fgm-version.jar". Clients connect to the game manager using port 3299. The protocol is described here. The first client to connect becomes the WHITE player (unless randomization is selected from the GUI).

Sample Programs/Code

I've written a basic AI program that you can test your program against. It's written in C# .NET so it requires Windows. Be careful not to tune your program too much just to beat my program. Beating mine doesn't necessarily mean yours will play well against other programs! However, if your program does beat it, you can have the satisfaction of beating your professor.

You are welcome to use the provided source code as you wish. I make no guarantees that these programs are free from bugs...

Move Format

Using the board coordinates shown below:

Send your moves in text using the following format, where X1,Y1 is the source coordinate of the piece to move and X2,Y2 is the destination coordinate of the piece:

More information will be posted later about the tournament rules.