Learn how to program a Chess game in C#!
Welcome to part 16 of my C# Chess tutorial.
In this video, we implement the Insufficient Material Rule.
It states that, if the remaining pieces are insufficient for checkmate, the game ends immediately in a draw.
We start by writing a Counting class which counts the remaining pieces on the board.
Using that class, we implement four cases where the Insufficient Material Rule takes effect.
Finally, we update the GameState class, so it ends the game if such a case occurs.
Assets:
https://ottobotcode.com/chess/ChessAs...
Source code is available here:
/ 78701
Chapters:
0:00 - Plan
0:12 - Insufficient Material Example
0:34 - Counting Pieces
5:54 - Detect Insufficient Material
13:07 - End Game When Detected
14:00 - Testing
14:51 - Other Dead Positions