diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2022-12-27 16:11:34 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2022-12-27 16:11:34 +0100 |
| commit | 9e8b8d630cdf7dfafdd0a37bb095b4e4afe10478 (patch) | |
| tree | 143a5aeadb9663f9139e74130e8939b56fb30b0e | |
| parent | d32baf9894ce67850c83b6e4a281bd1cfd921a93 (diff) | |
Update README.md
| -rw-r--r-- | README.md | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -17,7 +17,7 @@ ChessArbiter is a library that allow you to play chess games in C++. It ensures - Attacked squares - Checkmate - ... -- More features are coming soon! +- Support SAN (Short Algebraic Notation) parsing # How to setup ChessArbiter ChessArbiter can be used as a shared library in your project. @@ -28,7 +28,7 @@ Somewhere at the beginning of the file: #include "ChessArbiter.hpp" -Start playing: +Start playing with absolute moves: ChessArbiter arbiter; arbiter.Setup("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"); @@ -40,6 +40,19 @@ Start playing: // Game ends } +Play with SAN moves: + + ChessArbiter arbiter; + arbiter.Setup("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"); + std::string move=arbiter.ParseSAN("e4"); + // See ParseSANPromotion() to handle SAN moves with promotion + if(!arbiter.Play(move)){ + // Handle illegal moves + } + if(arbiter.IsCheckmate()){ + // Game ends + } + See `ChessArbiter.hpp` for more informations on the API. # CMake Integration |
