Handout F6

Quick links:

Contents:

Introduction

The 6.170 staff has enjoyed using your initial implementation, but feels that traditional antichess isn't enough of a rejection of the mainstream status quo. We need to up the ante and add another "anti".

You will extend your Antichess implementation to play "Anti-King Antichess", which adds an anti-king piece to the board. Your antichess implementation must be able to play both traditional and anti-king antichess, and be able to save and load games in both formats.

In addition, we have recently heard of some thing called the "Internet". The MachinePlayer specification of the preliminary release has been replaced in order to support play on the antichess.csail.mit.edu web site.

Rules of Anti-King Antichess

Anti-King Antichess board

The rules of Anti-King Antichess are identical to those of standard Antichess, except for the addition of an anti-king for each side. The anti-king starts in the square in front of the opposing Queen's pawn, as shown to the right (the anti-king is represented in this diagram by an upside-down king).

The anti-king is a king that is in check whenever it is not attacked by opposing pieces. For clarity, we are going to call this condition anticheck. If a player ends their turn with their anti-king not attacked, they are checkmated and lose. Anti-kings threaten friendly pieces, but do not attack opposing ones. Kings do not attack anti-kings, and anti-kings do not attack kings, so an anti-king next to a hostile king but not attacked by any other piece is not attacked and so in check. Since anti-kings are a form of king, they may not be captured, only mated.

Note that no piece is forced to capture an anti-king (because the anti-king can not be captured).

Handling Check Situations

Each move of player A must observe the following revised rules:
  1. If A's king is in check and/or A's anti-king is in anticheck, A must make a move which removes both of them from check/anticheck. If this is impossible, A is checkmated.
  2. A cannot move in a way that causes the king to come into check or anti-king to come into anticheck.
  3. If A can capture any piece (friendly or opposing), then it must capture some piece (unless disallowed by the previous rule).
  4. If A's king is in check or anti-king is in anticheck and A can move in such a way that both of them are out of check/anticheck by either taking a piece or in some other manner, A must capture a piece.
Castling may occur while the anti-king is in anticheck, but only if so doing would remove the anti-king from anticheck.

End of the Game

Player A wins the game against player B if:
  1. all pieces of A except for the king and anti-king and one other piece are taken, or
  2. player A checkmates player B, or
  3. player B's timer runs to 0.

Note that A may win the game with 3 pieces on the board: their king, anti-king, and one other piece which is attacking B's anti-king. B is forbidden to capture the last non-king non-anti-king piece, because doing so would put their anti-king in anticheck.

If player A checkmates player B and on the same turn takes a piece leaving B with just 3, player B wins (ie, the loss of pieces prevails). Note that this is different from standard antichess, where the checkmate would prevail.

Game File Format

The game file schema is unchanged. The rule set string for Anti-king Antichess is "6170-spring-2006-antiking". A black anti-king piece is denoted as follows:
<square id="d3" side="black" piece="king" antiking="true" />

Machine Player Changes

Instead of implementing the MachinePlayer interface, you will be required to implement the AiPlayerFactory interface from antichess.csail.mit.edu. The antichess.csail.mit.edu web site contains further specifications and packaging instructions. Your AI must be playable in the antichess.csail.mit.edu client.

We have provided a jar file of the net.antichess.ai package in antichess-ai.jar.

Note that AiPlayerFactory provides means for your AI to "learn" from its opponents by persisting state across games.

Antichess Tournament

The Antichess tournament will require that your machine player is proficient in playing both Antichess and Anti-King Antichess. You must ensure that you support the new rules in order to compete in the tournament. Any illegal move in the tournament results in disqualification.

The tournament will be run with the antichess.csail.mit.edu software. Your AI will play at least one practice game against every other competitor before the tournament begins.

Tournament Timing

To avoid non-terminating endgames, the tournament may, but is not required to, charge a full second of time for any move that takes less than a second. This will be reflected in the time passed to AiPlayer.getMove(). This will have no effect on your code requirements, but may have a slight impact on your AI if it keeps an internal clock or relies upon making very fast moves.

Draws

To avoid over-conservative play, the tournament will score a draw in the following two situations:
  1. The same board position has been repeated three times (the "Threefold repetition" rule). Positions are considered the same if the same player has the move, pieces of the same kind and colour occupy the same squares, and the possible moves of all the pieces of both players are the same (note that this includes castling and en passant moves).
  2. the last 50 moves have not involved a move of any pawn or a capture of any piece (the "Fifty move rule").

Draws are considered after any other end-game situations. For example, if the third repetition of a position results in a white's winning by checkmate, then white wins and a draw is not scored.

Wins score 3 points for the winner and 0 points for the loser; draws score 1 point each for the winner and loser. Note that, unlike in FIDE chess, draws are scored automatically by the tournament referee; they do not have to be requested.

Neither your Text UI nor your GUI needs to support draws, but your machine players may wish to know about them to avoid a draw if a win is possible.

Additional Images

For your convenience, we have put some images of anti-king pieces in the images directory for this project. You are not required to use these images.

Text UI

Your text ui should support playing Anti-king Antichess, but how it does so is up to you. Document your decisions. It should still be possible to play games of traditional antichess using your Text UI with unmodified game files; ie, you should not break backwards-compatibility when supporting this amendment.

Ambiguities

Parts of this amendment have been left intentionally vague. It is up to you to decide what (if any) clarifications are necessary. You should include any changes to your Revised Specification documentation in your final submission.

Design Decisions

Spend some time thinking about the best way to incorporate this change into your design. In your final design write-up, be sure to discuss the changes to your initial design (and the relevant trade-offs). You will be graded on how easily your initial design can support the amendment, and how cleanly you incorporate the amendment into your design.

Q & A

This section lists clarifications and answers to common questions about the amendment.

Question
This Anti-King piece is cool! Can I use it with regular chess?
Answer
Our game of Anti-King Antichess is deeply indebted to Peter Aronson's "Anti-King Chess II". You might like that.

Errata