You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+53-44Lines changed: 53 additions & 44 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,17 +2,16 @@
2
2
3
3
MinimalChess is a UCI chess engine written in C#.
4
4
5
-
It's focus on a *minimal* implementation of only the most important features and optimizations makes MinimalChess a good starting point for programmers with a working knowledge of C# but no prior experience in chess programming. MinimalChess is written in only a few hundred lines of idiomatic C# code where other engines (of comparable strength) often have thousands.
5
+
It's focus on a *minimal* implementation of only the most important features and optimizations makes MinimalChess a good starting point for programmers with a working knowledge of C# but no prior experience in chess programming. MinimalChess is written in only a few hundred lines of idiomatic C# code where other engines of comparable strength often have thousands.
6
6
7
7
The didactic nature of the project is reinforced by it's open source license (MIT) and a dedicated series of explanatory [Youtube](https://www.youtube.com/playlist?list=PL6vJSkTaZuBtTokp8-gnTsP39GCaRS3du) videos.
8
8
9
9
## Features
10
10
11
11
* A simple 8x8 Board representation: Just an array to represent the 64 squares and keep track of the pieces.
12
-
* A triangular PV-Table to keep track of the Principal Variation of best moves.
13
12
* A Transposition Table to store the score and best move of previously visited positions.
14
-
* Staged move generation: TT first, followed by the PV move, then MVV-LVA sorted captures, followed by known killer moves and finally the remaining quiet moves.
15
-
* Iterative Deepening Search with PVS, null-move pruningand Quiescence Search.
13
+
* Staged move generation: TT moves first, followed by MVV-LVA sorted captures, followed by killers and finally history-sorted quiet moves.
14
+
* Iterative Deepening Search with PVS, null-move pruning, futility pruning and late move reductions.
16
15
* Tapered PSTs with values tuned on a set of 725000 quiet, labeled positions.
17
16
* A 13th auto-tuned table for a dynamic, mobility-based evaluation component.
18
17
@@ -25,21 +24,67 @@ MinimalChess, just like most other chess programs, does not provide its own user
Once you have a chess GUI installed you can download the prebuild [binaries for Mac, Linux and Windows](https://github.com/lithander/MinimalChessEngine/releases/tag/v0.4) and extract the contents of the zip file into a location of your choice.
27
+
Once you have a chess GUI installed you can download the prebuild [binaries for Mac, Linux and Windows](https://github.com/lithander/MinimalChessEngine/releases/tag/v0.6) and extract the contents of the zip file into a location of your choice.
29
28
30
29
As a final step you have to register the engine with the GUI. The details depend on the GUI you chose but there should be something like "Add Engine..." somewhere in the settings.
31
30
32
31
After this you should be ready to select MinimalChess as a player!
33
32
33
+
## Compiling the engine
34
+
35
+
This repository contains 3 projects:
36
+
1.**MinimalChessBoard** is a command-line based GUI
37
+
1.**MinimalChessEngine** is a [UCI](https://en.wikipedia.org/wiki/Universal_Chess_Interface) compatible chess engine
38
+
1.***MinimalChess*** is a library with shared chess logic and algorithms used by the other two applications
39
+
40
+
### Windows
41
+
42
+
To compile MinimalChess on Windows I suggest you install Visual Studio and open **MinimalChessEngine.sln** in it.
43
+
You will need to have the [.NET Core 5.0 SDK](https://dotnet.microsoft.com/download/dotnet/5.0) installed.
44
+
Hit the play button and it should compile and start!
45
+
46
+
### Linux
47
+
48
+
Read the official instructions on how to [Install .NET on Linux](https://docs.microsoft.com/en-us/dotnet/core/install/linux).
49
+
There are also [Ubuntu Linux specific installations instructions](https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu).
50
+
51
+
You can clone the repository and compile it like this:
[__Version 0.6__](https://github.com/lithander/MinimalChessEngine/releases/tag/v0.6) uses an improved transposition table with two buckets and aging. It also adds late move reductions and deep futility pruning. Quiet moves are now sorted based on a simple history heuristic which has a nice synergy with LMR. In total these changes allow MinimalChess to search much deeper (at the cost of accuracy) so that it gains about 200 ELO in playing strength over the previous version.
77
+
78
+
### Version 0.5
35
79
```
36
80
Version: 0.5
37
81
Size: 707 LOC
38
82
Strength: 2200 ELO
39
83
```
40
84
[__Version 0.5__](https://github.com/lithander/MinimalChessEngine/releases/tag/v0.5) adds a 13th tuned table for a mobility-based evaluation term, null-move pruning and a simple transposition table. I also changed the target framework to .NET 5.
41
-
With these changes MinimalChess gains about 350 ELO in playing strength over the previous version.
85
+
With these changes MinimalChess gains about 350 ELO in playing strength over the previous version and is listed at [2264 ELO](https://ccrl.chessdom.com/ccrl/404/cgi/engine_details.cgi?eng=MinimalChess%200.5%2064-bit#MinimalChess_0_5_64-bit) on the CCRL.
42
86
87
+
### Version 0.4
43
88
```
44
89
Version: 0.4
45
90
Size: 610 LOC
@@ -50,7 +95,7 @@ I also added a [killer heuristic](https://www.chessprogramming.org/Killer_Heuris
50
95
A new time control logic now allocates the given time budget smarter, especially in modes where there's an increment each move, and the 'nodes' and 'depth' constraints are now supported in all modes.
51
96
MinimalChess 0.4.1 is listed at [1883 ELO](http://ccrl.chessdom.com/ccrl/404/cgi/engine_details.cgi?print=Details&each_game=1&eng=MinimalChess%200.4.1%2064-bit#MinimalChess_0_4_1_64-bit) on the CCRL.
52
97
53
-
98
+
### Version 0.3
54
99
```
55
100
Version: 0.3
56
101
Size: 641 LOC
@@ -60,49 +105,14 @@ Strength: 1575 ELO
60
105
With these changes MinimalChess gains about 500 ELO in playing strength over the previous version and achieved [1571 ELO](http://ccrl.chessdom.com/ccrl/404/cgi/engine_details.cgi?match_length=30&each_game=1&print=Details&each_game=1&eng=MinimalChess%200.3%2064-bit#MinimalChess_0_3_64-bit) on the CCRL.
61
106
This version also introduces a rather unique feature: Sets of PSTs are defined in separate files and can be selected via an UCI option. This allows the user to tweak the values or write their own tables from scratch and by this alter the playstyle of the engine considerably. No programming experience required!
62
107
108
+
### Version 0.2
63
109
```
64
110
Version: 0.2
65
111
Size: 502 LOC
66
112
Strength: 1059 ELO
67
113
```
68
114
[__Version 0.2__](https://github.com/lithander/MinimalChessEngine/releases/tag/v0.2) uses Iterative Deepening search with Alpha-Beta pruning. It collects the Principal Variation (PV) and when available plays PV moves first. Other than that there's no move ordering. Positions are evaluated by counting material only. This lack of sophistication causes it to play rather weak at [1059 ELO](http://ccrl.chessdom.com/ccrl/404/cgi/engine_details.cgi?print=Details&each_game=1&eng=MinimalChess%200.2%2064-bit#MinimalChess_0_2_64-bit) on the CCRL. I tried to the write code to be as simple as possible to both understand and explain. It could be smaller or faster but I doubt it could be much simpler than this version.
69
115
70
-
## Compiling the engine
71
-
72
-
This repository contains 3 projects:
73
-
1.**MinimalChessBoard** is a command-line based GUI
74
-
1.**MinimalChessEngine** is a [UCI](https://en.wikipedia.org/wiki/Universal_Chess_Interface) compatible chess engine
75
-
1.***MinimalChess*** is a library with shared chess logic and algorithms used by the other two applications
76
-
77
-
### Windows
78
-
79
-
To compile MinimalChess on Windows I suggest you install Visual Studio and open **MinimalChessEngine.sln** in it.
80
-
You will need to have the [.NET Core 3.1 SDK](https://dotnet.microsoft.com/download/dotnet/3.1) installed.
81
-
Hit the play button and it should compile and start!
82
-
83
-
### Linux
84
-
85
-
Read the official instructions on how to [Install .NET on Linux](https://docs.microsoft.com/en-us/dotnet/core/install/linux).
86
-
There are also [Ubuntu Linux specific installations instructions](https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu).
87
-
88
-
You can clone the repository and compile it like this:
I have documented important milestones of the development in a series of [Youtube](https://www.youtube.com/playlist?list=PL6vJSkTaZuBtTokp8-gnTsP39GCaRS3du) videos.
@@ -124,7 +134,6 @@ Command | Description
124
134
[fenstring] | Setup the board to represent the given position.
125
135
! [depth] | The computer plays the next move, searched with the given depth.
126
136
? [depth] | List all available moves
127
-
?? | Print the resulting board for each available move
128
137
reset | Reset the board to the start position.
129
138
perft [depth] | Compute perft values of the given depth
130
139
divide [depth] | Compute perft values of all available moves
0 commit comments