Learn how to program a Chess game in C#!
Welcome to the final part of my C# Chess tutorial (at least for now).
This time, we finish implementing the Threefold Repetition Rule.
The strategy we'll use, is to encode each state as a specific string.
Two states will have the same string encoding if and only if, they are considered equal.
That way, we can keep track of the strings for each state and if a string occurs three times, we have Threefold Repetition!
Assets:
https://ottobotcode.com/chess/ChessAs...
Source code is available here:
/ 78701
Forsyth-Edwards Notation (FEN):
https://en.wikipedia.org/wiki/Forsyth...
Patreon:
/ ottobotcode
Chapters:
0:00 - The Final Part!
0:19 - Implementation Strategy
1:38 - String Encoding
3:28 - Piece Characters
5:18 - Encode Rows
7:31 - Encode All Pieces
8:37 - Encode Current Player
9:34 - Encode Castling Rights
12:13 - Encode En Passant
14:39 - Store State History
17:56 - Threefold Repetition
19:24 - Congratulations!