Programming a Chess Game in C# | Part 9 - Checkmate & Stalemate

Опубликовано: 08 Август 2026
на канале: OttoBotCode
5,419
134

Learn how to program a Chess game in C#!

Welcome to part 9 of my C# Chess tutorial.
In this part we do the groundwork for handling when a game ends.
We add a Result class storing the winning player and the reason why the game ended.
Finally, we write code to detect checkmate and stalemate!

Assets:
https://ottobotcode.com/chess/ChessAs...

Source code is available here:
  / 78701  

Chapters:
0:00 - Plan
0:11 - Checkmate Example
0:37 - Stalemate Example
1:01 - EndReason Enum
2:19 - Game Result
4:59 - Generate All Moves
6:37 - Detect Checkmate & Stalemate
8:50 - Testing!