From 3b60b89a7cd8fa484b3f290ea174e2498e1a60f9 Mon Sep 17 00:00:00 2001 From: geras1mleo Date: Wed, 1 Jun 2022 22:57:18 +0200 Subject: [PATCH] Update README.md --- README.md | 57 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 1c9f05f..5f769f0 100644 --- a/README.md +++ b/README.md @@ -13,28 +13,29 @@ ## Chess lib includes: -- Chess board with 2-dimentional array of `Pieces` -- Generation, Validation and Execution of `Moves` on Chess board -- Logic to `Convert`: - - `Move` into `SAN` and back into Move object - - `Chess Board`into `FEN` and back into ChessBoard object - - `Chess Game` into `PGN` and back into ChessBoard object -- Event Handlers: - - `OnInvalidMoveKingChecked` - Raises when trying to execute move that places own king in check - - `OnWhiteKingCheckedChanged`/`OnBlackKingCheckedChanged` with state (checked or not) and its position - - `OnPromotePawn` with PromotionEventArgs.PromotionResult (default: PromotionToQueen) - - `OnEndGame` with according end game info (`Win`/`Loss`/`Draw`) - - `OnCaptured` with captured piece and all recently captured pieces (White/Black) -- `End Game` Declaration: `Draw` or `Resign` of one of sides -- `Navigation` between executed moves: - - `First`/`Last` - - `Next`/`Previous` - - Also: `board.MoveIndex` property to navigate direct to specific move -- `Cancelation` of last executed move +- **ChessBoard** with 2-dimentional array of **Pieces** +- Generation, Validation and Execution of **Moves** on chess board +- **Parse**: + - **Move object** into [SAN](https://www.chessprogramming.org/Algebraic_Chess_Notation#Standard_Algebraic_Notation_.28SAN.29) and back into Move object +- **Load** and play further: + - **Chess _Board_** from [FEN](https://www.chessprogramming.org/Forsyth-Edwards_Notation) and back to *FEN-string* + - **Chess _Game_** from [PGN](https://en.wikipedia.org/wiki/Portable_Game_Notation) and back to *PGN-string* +- **Event handlers** are raised: + - *OnInvalidMoveKingChecked* - when trying to execute move that places own king in **check** + - *On(White/Black)KingCheckedChanged* - with **state** (checked or not) and its **position** + - *OnPromotePawn* - with *PromotionEventArgs.PromotionResult* (default: **PromotionToQueen**) + - *OnEndGame* - with according end game info (**Won Side**/**Draw**) + - *OnCaptured* - with captured piece and all recently captured pieces (**White**/**Black**) +- **End Game** Declaration: **Draw** or **Resign** of one of sides +- **Navigation** between executed moves: + - **First**/**Last** + - **Next**/**Previous** + - Also: **board.MoveIndex** property to navigate directly to specific move +- **Cancelation** of last executed move # Usage! -Example simple console chess game: +Example simple **console** chess game: ```csharp using Chess; @@ -67,7 +68,7 @@ Console.WriteLine(board.ToPgn()); // 1. e4 f5 2. f4 g5 3. Qh5# 1-0 ``` -Example random chess game: +Example **random** chess game: ```csharp while (!board.IsEndGame) @@ -131,13 +132,13 @@ board.Move("e8=K"); // => Bad board.Move("0-0"); // => Bad ``` -Move pieces using Move object and corresponding positions: +Move pieces using **Move object** and corresponding positions: ```csharp board.Move(new Move("b1", "c3")); ``` -Ambiguity: +**Ambiguity**: ```csharp if(ChessBoard.TryLoadFromPgn("1. e4 e5 2. Ne2 f6", out var board)) @@ -188,7 +189,7 @@ board.LoadFen("rnb1kbnr/pppppppp/8/8/8/8/5q2/7K w kq - 0 1"); board.EndGame... // => { EndgameType = Stalemate, WonSide = null } ``` -Load full chess game from PGN: +Load full chess game from **PGN**: ```csharp board = ChessBoard.LoadFromPgn( @@ -211,7 +212,7 @@ board.ToAscii(); // a b c d e f g h ``` -Alternative moves and comments are (temporary) skipped
+Alternative moves and comments are (temporarily) skipped
In further versions:
Navigate between alternative branches, also load branches from PGN
Adding comments to each move
@@ -230,9 +231,15 @@ board.Resign(PieceColor.Black); board.EndGame... // => { EndgameType = Resigned, WonSide = White } ``` +## [Unit Tests](/ChessUnitTests/UnitTests.cs) +Here you can see all the tests that have been used to test and improve chess library + +## [Benchmarks](/ChessBenchmarks/Benchmarks.cs) +Here you can see the evolution of performance of chess library + ## Found a bug? Drop to Issues
-Or to: sviatoslav.harasymchuk@gmail.com
+Or: sviatoslav.harasymchuk@gmail.com

Thanks in advance!