From 9e8b8d630cdf7dfafdd0a37bb095b4e4afe10478 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Tue, 27 Dec 2022 16:11:34 +0100 Subject: [PATCH] Update README.md --- README.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 828c355..ccf54a5 100644 --- a/README.md +++ b/README.md @@ -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