Is there any library which can be used to validate chess moves and simulate games in .NET? It would be great if the library can understand moves in Algebraic notation and also provide simple API for making moves. For example, game.Move("E2","E4") etc. In the second case, the library should be able to generate Algebraic notation for the moves. I don't want it to make moves or to play chess etc, just a library for game validation and game simulation. Any links?
The chess module is a pure Python chess library with move generation, move validation and support for common formats. We can play chess with it. It will help us to move the king queen, pawn, bishops and knights.
python-chess is a chess library for Python, with move generation, move validation, and support for common formats. This is the Scholar's mate in python-chess: >>> import chess >>> board = chess. Board() >>> board.
Notation for moves. Each move of a piece is indicated by the piece's uppercase letter, plus the coordinate of the destination square. For example, Be5 (bishop moves to e5), Nf3 (knight moves to f3). For pawn moves, a letter indicating pawn is not used, only the destination square is given.
chess. js is a Javascript chess library that is used for chess move generation/validation, piece placement/movement, and check/checkmate/stalemate detection - basically everything but the AI. chess. js has been extensively tested in node. js and most modern browsers.
Have a look at the C# Chess Game Starter Kit. It is a C# Open Source Application that does exactly what you requested and it is free for commercial use.
For a detailed explanation of the source code see:
http://www.chessbin.com
There is also sharpchess which is open source (under GNU GPL) and written for .Net v2 It has a core engine as well as a WinForm GUI. Although it does play chess, I believe that you potentially strip out the "game engine" to leave a shell for simulation.
Some bullet points from the site
* Graphical chess board.
* Helpful high-lighting of legal chess moves, when clicking on a piece.
* Move history displayed.
* Undo/Redo moves.
* Load/Save chess games during play.
* Replay your saved games.
* Paste FEN positions from the clipboard.
Chess engine features
* WinBoard compatible.
* 0x88 board representation.
* Opening book containing over 1300 varied opening positions.
Programming features
* A well-designed, and hopefully easy-to-understand, object-model that will enable other developers to quickly get involved in the project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With