Unorthodox is a framework for implementing chess variants and test-playing them against a basic computer opponent.
Start a game from the command line, e.g.
python3 orthodoxchess.py
Input moves by specifying their origin and target squares, e.g. "e2e4".
- For pawn promotions add the desired piece type, e.g. "e2e4Q".
- For castling input the king's move, e.g. "e1g1".
Implementing a variant is generally a five-step process.
- Import or create a board.
- Import or create some pieces.
- Put pieces on the board.
- Designate royal pieces that must be checkmated.
- Call the
play
function.
See the variants already implemented for examples.
Tuples of two integers are used for board sizes, coordinates and offsets, i.e. changes in coordinates. The first integer is the rank, the second integer is the file. (0, 0) is white's upper left corner.