
Handles chess rules, move generation, and game state management with complete chess logic, FEN/PGN support, and integration with engines like Stockfish. Offers extensible design.
A Kotlin Multiplatform library for handling chess rules, move generation, and game state management — designed for flexibility, extensibility, and integration with engines like Stockfish.
git clone https://github.com/alluhemanth/chess-core-kmp.git./gradlew buildrepositories {
mavenCentral()
}
dependencies {
implementation("io.github.alluhemanth:chess-core:1.0.1")
}The ChessGame class provides a complete chess game implementation, including board state management, move generation,
and game logic. Below is an overview of its key methods and usage.
val game = ChessGame()
game.makeSanMove("e4")
game.makeSanMove("e5")
game.makeUciMove("e2e4")
game.makeUciMove("e7e5")
val move = game.getLegalMoves().first()
game.makeMove(move)
game.undo()
game.redo()
game.getBoard()
game.getCurrentPlayer()
game.isGameOver()
val result = game.getGameResult()
val legalMoves = game.getLegalMoves()
game.getFen()
game.loadFen("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1")
val pgn = game.getPgn()
game.loadPgn("1. e4 e5 2. Nf3 Nc6")src/commonMain/kotlin: Contains the core source code for the chess engine.
board: Classes related to the chessboard, squares, files, and ranks.exception: Custom exceptions for handling errors.game: Game state management, rules, and results.move: Move generation and representation.piece: Piece types, colors, and representation.utils: Utilities for handling FEN, PGN, and SAN (Standard Algebraic Notation).src/test/kotlin: Contains unit tests for the project.Detailed documentation for this project is available at chess-core-kmp documentation.
Contributions are welcome! Please see the CONTRIBUTING file for detailed guidelines on how to contribute, report issues, and suggest features.
The rook icon used in this project is attributed to:
Cburnett, CC BY-SA 3.0, via Wikimedia Commons.
This project is licensed under the MIT License. See the LICENSE file for details.
A Kotlin Multiplatform library for handling chess rules, move generation, and game state management — designed for flexibility, extensibility, and integration with engines like Stockfish.
git clone https://github.com/alluhemanth/chess-core-kmp.git./gradlew buildrepositories {
mavenCentral()
}
dependencies {
implementation("io.github.alluhemanth:chess-core:1.0.1")
}The ChessGame class provides a complete chess game implementation, including board state management, move generation,
and game logic. Below is an overview of its key methods and usage.
val game = ChessGame()
game.makeSanMove("e4")
game.makeSanMove("e5")
game.makeUciMove("e2e4")
game.makeUciMove("e7e5")
val move = game.getLegalMoves().first()
game.makeMove(move)
game.undo()
game.redo()
game.getBoard()
game.getCurrentPlayer()
game.isGameOver()
val result = game.getGameResult()
val legalMoves = game.getLegalMoves()
game.getFen()
game.loadFen("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1")
val pgn = game.getPgn()
game.loadPgn("1. e4 e5 2. Nf3 Nc6")src/commonMain/kotlin: Contains the core source code for the chess engine.
board: Classes related to the chessboard, squares, files, and ranks.exception: Custom exceptions for handling errors.game: Game state management, rules, and results.move: Move generation and representation.piece: Piece types, colors, and representation.utils: Utilities for handling FEN, PGN, and SAN (Standard Algebraic Notation).src/test/kotlin: Contains unit tests for the project.Detailed documentation for this project is available at chess-core-kmp documentation.
Contributions are welcome! Please see the CONTRIBUTING file for detailed guidelines on how to contribute, report issues, and suggest features.
The rook icon used in this project is attributed to:
Cburnett, CC BY-SA 3.0, via Wikimedia Commons.
This project is licensed under the MIT License. See the LICENSE file for details.