Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Geras1mleo committed Jun 1, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 49e214c commit 3b60b89
Showing 1 changed file with 32 additions and 25 deletions.
57 changes: 32 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -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<br/>
Alternative moves and comments are (temporarily) skipped<br/>
In further versions:<br/>
Navigate between alternative branches, also load branches from PGN<br/>
Adding comments to each move<br/>
@@ -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 <a href="https://github.com/Geras1mleo/Chess/issues">Issues</a><br/>
Or to: sviatoslav.harasymchuk@gmail.com<br/>
Or: sviatoslav.harasymchuk@gmail.com<br/>
<br/>
Thanks in advance!

0 comments on commit 3b60b89

Please sign in to comment.