|
Cute Chess
0.1
|
A board for ASEAN-Chess. More...
#include <aseanboard.h>
Public Member Functions | |
| AseanBoard () | |
| virtual Board * | copy () const |
| virtual QString | defaultFenString () const |
| virtual QString | variant () const |
Public Member Functions inherited from Chess::MakrukBoard | |
| MakrukBoard () | |
Public Member Functions inherited from Chess::ShatranjBoard | |
| ShatranjBoard () | |
Public Member Functions inherited from Chess::WesternBoard | |
| virtual int | height () const |
| virtual int | reversibleMoveCount () const |
| WesternBoard (WesternZobrist *zobrist) | |
| virtual int | width () const |
Public Member Functions inherited from Chess::Board | |
| Board (Zobrist *zobrist) | |
| virtual CoordinateSystem | coordinateSystem () const |
| QString | fenString (FenNotation notation=XFen) const |
| GenericMove | genericMove (const Move &move) const |
| void | initialize () |
| bool | isLegalMove (const Move &move) |
| virtual bool | isRandomVariant () const |
| bool | isRepetition (const Move &move) |
| bool | isValidSquare (const Square &square) const |
| quint64 | key () const |
| QVector< Move > | legalMoves () |
| void | makeMove (const Move &move, BoardTransition *transition=nullptr) |
| Move | moveFromGenericMove (const GenericMove &move) const |
| Move | moveFromString (const QString &str) |
| QString | moveString (const Move &move, MoveNotation notation) |
| Piece | pieceAt (const Square &square) const |
| Piece | pieceFromSymbol (const QString &pieceSymbol) const |
| QStringList | pieceList (Side side) const |
| QString | pieceString (int pieceType) const |
| QString | pieceSymbol (Piece piece) const |
| int | plyCount () const |
| int | repeatCount () const |
| QString | representation (Piece piece) const |
| int | reserveCount (Piece piece) const |
| virtual QList< Piece > | reservePieceTypes () const |
| void | reset () |
| bool | setFenString (const QString &fen) |
| Side | sideToMove () const |
| QString | startingFenString () const |
| Side | startingSide () const |
| virtual Result | tablebaseResult (unsigned int *dtm=nullptr) const |
| void | undoMove () |
| virtual Side | upperCaseSide () const |
| virtual bool | variantHasDrops () const |
| virtual bool | variantHasOptionalPromotions () const |
| virtual bool | variantHasWallSquares () const |
| virtual | ~Board () |
Protected Member Functions | |
| virtual void | addPromotions (int sourceSquare, int targetSquare, QVarLengthArray< Move > &moves) const |
| virtual int | countingLimit () const |
| virtual CountingRules | countingRules () const |
| virtual int | promotionRank (int file=0) const |
| virtual Result | result () |
| virtual QString | vFenString (FenNotation notation) const |
| virtual bool | vSetFenString (const QStringList &fen) |
Protected Member Functions inherited from Chess::MakrukBoard | |
| virtual void | generateMovesForPiece (QVarLengthArray< Move > &moves, int pieceType, int square) const |
| virtual void | generatePawnMoves (int sourceSquare, QVarLengthArray< Move > &moves) const |
| virtual bool | inCheck (Side side, int square=0) const |
| void | initHistory () |
| virtual bool | insufficientMaterial () const |
| int | pieceCount (Side side=Side::NoSide, int pieceType=Piece::NoPiece) const |
| Result | resultFromCounting () const |
| void | setAllPieceCounters () |
| virtual void | vInitialize () |
| virtual void | vMakeMove (const Move &move, BoardTransition *transition) |
| virtual void | vUndoMove (const Move &move) |
Protected Member Functions inherited from Chess::ShatranjBoard | |
| virtual bool | canBareOpponentKing () |
| virtual bool | hasCastling () const |
| virtual bool | pawnHasDoubleStep () const |
Protected Member Functions inherited from Chess::WesternBoard | |
| virtual int | captureType (const Move &move) const |
| virtual int | castlingFile (CastlingSide castlingSide) const |
| int | enpassantSquare () const |
| bool | hasCastlingRight (Side side, CastlingSide castlingSide) const |
| virtual bool | hasEnPassantCaptures () const |
| virtual bool | isLegalPosition () |
| virtual bool | kingCanCapture () const |
| virtual bool | kingsCountAssertion (int whiteKings, int blackKings) const |
| int | kingSquare (Side side) const |
| virtual QString | lanMoveString (const Move &move) |
| virtual Move | moveFromLanString (const QString &str) |
| virtual Move | moveFromSanString (const QString &str) |
| virtual bool | parseCastlingRights (QChar c) |
| int | pawnAmbiguity (StepType type=FreeStep) const |
| void | removeCastlingRights (int square) |
| void | removeCastlingRights (Side side) |
| virtual QString | sanMoveString (const Move &move) |
| virtual bool | variantHasChanneling (Side side, int square) const |
| virtual QString | vFenIncludeString (FenNotation notation) const |
| virtual bool | vIsLegalMove (const Move &move) |
Protected Member Functions inherited from Chess::Board | |
| void | addToReserve (const Piece &piece, int count=1) |
| int | arraySize () const |
| bool | canMove () |
| Square | chessSquare (int index) const |
| Square | chessSquare (const QString &str) const |
| void | generateDropMoves (QVarLengthArray< Move > &moves, int pieceType) const |
| void | generateHoppingMoves (int sourceSquare, const QVarLengthArray< int > &offsets, QVarLengthArray< Move > &moves) const |
| void | generateMoves (QVarLengthArray< Move > &moves, int pieceType=Piece::NoPiece) const |
| void | generateSlidingMoves (int sourceSquare, const QVarLengthArray< int > &offsets, QVarLengthArray< Move > &moves) const |
| const Move & | lastMove () const |
| virtual int | maxPieceSymbolLength () const |
| bool | moveExists (const Move &move) const |
| Piece | pieceAt (int square) const |
| bool | pieceHasMovement (int pieceType, unsigned movement) const |
| void | removeFromReserve (const Piece &piece) |
| virtual int | reserveType (int pieceType) const |
| void | setPieceType (int type, const QString &name, const QString &symbol, unsigned movement=0, const QString &gsymbol=QString()) |
| void | setSquare (int square, Piece piece) |
| int | squareIndex (const Square &square) const |
| int | squareIndex (const QString &str) const |
| QString | squareString (int index) const |
| QString | squareString (const Square &square) const |
| void | xorKey (quint64 key) |
Additional Inherited Members | |
Public Types inherited from Chess::WesternBoard | |
| enum | WesternPieceType { Pawn = 1, Knight, Bishop, Rook, Queen, King } |
Public Types inherited from Chess::Board | |
| enum | CoordinateSystem { NormalCoordinates, InvertedCoordinates } |
| enum | FenNotation { XFen, ShredderFen } |
| enum | MoveNotation { StandardAlgebraic, LongAlgebraic } |
Protected Types inherited from Chess::MakrukBoard | |
| enum | CountingRules { Makruk, BareKing } |
| enum | MakrukPieceType { Bia = Pawn, Ma = Knight, Khon = Bishop, Rua = Rook, Met = Queen, Khun = King } |
Protected Types inherited from Chess::ShatranjBoard | |
| enum | ShatranjPieceType { Ferz = Queen, Alfil = Bishop } |
Protected Types inherited from Chess::WesternBoard | |
| enum | CastlingSide { QueenSide, KingSide, NoCastlingSide } |
| enum | StepType { NoStep = 0, FreeStep = 1, CaptureStep = 2 } |
Protected Attributes inherited from Chess::WesternBoard | |
| QVarLengthArray< PawnStep, 8 > | m_pawnSteps |
Static Protected Attributes inherited from Chess::MakrukBoard | |
| static const unsigned | SilverGeneralMovement = 256 |
Static Protected Attributes inherited from Chess::ShatranjBoard | |
| static const unsigned | AlfilMovement = 32 |
| static const unsigned | FerzMovement = 16 |
Static Protected Attributes inherited from Chess::WesternBoard | |
| static const unsigned | BishopMovement = 4 |
| static const unsigned | KnightMovement = 2 |
| static const unsigned | RookMovement = 8 |
A board for ASEAN-Chess.
ASEAN-Chess is a standardised variant of chess defined by the ASEAN Chess Confederation. It is based both on standard chess and Makruk.
ASEAN-Chess is played on a standard chess board. The pieces are named as in standard chess, but have the movements of Makruk. So the Queen has the movement of the Met (Ferz, 1 square diagonally), and the Bishop moves like the Khon in Makruk (or the Silver General in Shogi): 1 square diagonally or 1 square straight forward. There is no castling and pawns have no initial double steps.
The starting position has the pawns on the third own rank, like in Makruk. However, the pieces on the base rank are placed in the starting order of standard chess. Pawns promote on the eighth rank to either Queen, Rook, Bishop, or Knight.
Like in standard chess giving mate wins, stalemate is a draw, insufficient material is a draw, and after fifty consecutive moves without any pawn move and any capture a draw can be claimed. However, three-fold repetition of a move does not achieve a draw. A game is drawn when no side can be checkmated at all by any sequence of legal moves.
When a King is left without any pieces the material on the board is evalua- ted at once. The stronger side must give mate within 16 moves if they have a Rook. If they have a Bishop and a Queen the limit is 44 moves. If they have a Knight and a Queen the limit is 64 moves.
| Chess::AseanBoard::AseanBoard | ( | ) |
|
protectedvirtual |
Adds pawn promotions to a move list.
This function is called when a pawn can promote by moving from sourceSquare to targetSquare. This function generates all the possible promotions and adds them to moves.
Reimplemented from Chess::ShatranjBoard.
|
virtual |
Creates and returns a deep copy of this board.
Reimplemented from Chess::MakrukBoard.
|
protectedvirtual |
Returns maximum count of plies allowed to finish the game: Limit for Board's Honour or Pieces' Honour counting.
Reimplemented from Chess::MakrukBoard.
|
protectedvirtual |
Returns type of counting rules to apply. Default: Makruk.
Reimplemented from Chess::MakrukBoard.
|
virtual |
Returns the variant's default starting FEN string.
Reimplemented from Chess::MakrukBoard.
|
protectedvirtual |
Returns the relative rank of pawn promotions counting from 0 for the first rank. The default returns 5 for promotions on the sixth rank. The formal file parameter is unused. Override this method if the promotion rank is not uniform.
Reimplemented from Chess::MakrukBoard.
|
protectedvirtual |
Returns the result of the game, or Result::NoResult if the game is in progress.
Reimplemented from Chess::MakrukBoard.
|
virtual |
Returns the name of the chess variant.
Reimplemented from Chess::MakrukBoard.
|
protectedvirtual |
When using Makruk counting rules (no Western counting)
This method uses an own total ply counter to keep track of the full move count.
Examples: Default FEN: rnsmksnr/8/pppppppp/8/8/PPPPPPPP/8/RNSKMSNR w - 0 0 1 KSSMvK black mates: 8/8/2m5/s7/8/1k6/1s6/1K6 w - 44 38 182
Reimplemented from Chess::MakrukBoard.
|
protectedvirtual |
This method reads FEN with full Makruk/Ouk counting support (A), standard FEN (B), and short FEN-like notation without castling rights and en passant fields (C). The latter two use Western counting and ignore Makruk counting.
A: rnsmksnr/8/pppppppp/8/8/PPPPPPPP/8/RNSKMSNR w - 0 0 1
B: rnsmksnr/8/pppppppp/8/8/PPPPPPPP/8/RNSKMSNR w - - 0 1 C: rnsmksnr/8/pppppppp/8/8/PPPPPPPP/8/RNSKMSNR w 0 1
FEN with Ouk initial move rights instead of castling rights are supported by OukBoard. Format C does not carry this information. Also see OukBoard.
Reimplemented from Chess::MakrukBoard.
1.8.11