This site runs matching pennies tournaments.

Programs compete with one another, and with system bots, in an attempt to win as many rounds as possible.

There is no fee to participate.

Tournament rules

The rules are as follows:

  • Disc space - Uncompressed source code should be smaller than 20MB.

  • Memory - Memory usage should be smaller than 20MB.

  • Time - No longer than 1/10 second per move (average) - on "reasonable" (circa 4 Ghz) hardware.

  • No sabotage! - Programs that attempt to sabotage their competitors or interfere with them will be disqualified.

  • No spying! - Programs that attempt to spy on their competitors' interior workings will also be disqualified.

  • No slaves! - Any programs that are found to behave as "slaves" towards other "master" programs will find themselves disqualified. Note that being a "master" program (who takes advantage of slaves) is not itself forbidden - and will not lead to disqualification.

  • No cheating! - try to win by playing the matching pennies game - rather than by trying to find ways to game the system.

Rule notes

Identification of sabotage, syping and slavery is at the discretion of the tournament organisers.

Obfuscation (and squeezing)) are contrary to the spirit of the contest. Obfuscation is not explicitly forbidden, though. However, if very many people use it, it may be in future contests.

There is also a tournament prize. Please note that that has additional rules associated with it.

Rule explanation

Program code must be open source - since part of the point of the tournament is to encourage people to exhibit their code.

Source code

To participate, download the source code from our SourceForge project.

Then, make your own agent. If you are working in Java, that involves implementing the IPredict interface.

That looks like this:

package matchingpennies;

public interface IPredict {
	void initialise();
	String my_name();
	Coin predict_next(Coin my_last, Coin your_last);
It's your responsibility to track the history of the game however you see fit - but there is plenty of sample code which does that.

The predict_next(...) method feeds you your last move - as well as your opponent's last move. The reason a strategy's last move is included (when the program can probabaly still remember what it just played) is to allow strategies to conveniently operate collectively. If moves are approved by a committee, the move a strategy proposes may not be the same as the one that is eventually played.

Depost the agent in the package - and it will be picked up automatically by the system.

If you need any additional classes, put them in the agents.resources package.

The main class is in the Main class in the default package.

If you are working in another language, you must implement the Matching Pennies Command Line Protocol.

Hopefully, reference implementations of this will be made available in various languages in due course.

Agent source code

Various agents are included in the source code distribution, which is part of our SourceForge project.

If you would prefer, you can also look through the source code to some agents using a web browser here.

Tournament structure

The tournament managers will decide how many rounds are played - and which programs are paired-up to compete.

Programs may reasonably expect to participate in at least 100 sequential rounds with each opponent - and not more than 100,000 rounds.

Beware of making the response time of your code depend heavily on the number of rounds so far - this could potentially cause disqualification on speed grounds.

It is likely that there will be at least two rounds, with many programs not making it through the first round. This will help to weed out any "slave" submissions.

The winner

The winning program will have the most matched coins at the end of the tournament.

Submitting agents to the tournament

Tournament entrants are best submitted by email - to the address given here.

Please put "Matching Pennies" somewhere in the subject line.

Tournament entrants will be submitted to The Matching Pennies Prize - unless you tell us otherwise.

Tournament results

For the results of previous tournaments, see here.

Tim Tyler | Contact |