A chess engine written in C# (.NET 9) that communicates over the Universal Chess Interface (UCI) protocol. The engine is named Cheese and is built to be plugged into any UCI-compatible chess GUI.
The Universal Chess Interface (UCI) is an open communication protocol that allows chess engines to interact with graphical interfaces (GUIs) or other programs. It works over standard input/output (stdin/stdout), making integration straightforward and GUI-agnostic.
Popular UCI-compatible GUIs include:
Chess-Engine-Using-UCI/
├── Program.cs # Entry point — starts the UCI loop
├── UCI.cs # UCI protocol handler (uci, isready, position, go, quit)
├── Board.cs # Board representation
├── Piece.cs # Piece definitions
├── Move.cs # Move representation
├── Engine.cs # Search algorithm
├── Evaluation.cs # Position evaluation
├── Utils.cs # Shared utility functions
└── Chess-Engine-Using UCI.csproj
| File | Responsibility |
|---|---|
UCI.cs |
Reads UCI commands from stdin, dispatches to handlers |
Board.cs |
Stores and updates the board state (pieces, side to move, etc.) |
Piece.cs |
Defines piece types and colours |
Move.cs |
Encodes a chess move (from, to, promotion, flags) |
Engine.cs |
Implements the search (minimax / alpha-beta) |
Evaluation.cs |
Scores a position (material, piece-square tables, etc.) |
Utils.cs |
Helper functions shared across modules |
| Command | Status | Description |
|---|---|---|
uci |
✅ | Responds with engine identity and uciok |
isready |
✅ | Responds with readyok |
position |
🚧 In progress | Parses start position and move list |
go |
🚧 In progress | Starts the search and returns bestmove |
quit |
✅ | Exits the engine cleanly |
Check your installation:
dotnet --versionClone the repository:
git clone https://github.com/MuditAtrey/Chess-Engine-Using-UCI.git
cd Chess-Engine-Using-UCIBuild:
dotnet buildRun directly:
dotnet runOnce running, the engine listens for UCI commands on stdin. You can type commands manually to test it:
uci
isready
quit
Build a standalone executable:
dotnet publish -c Release -r win-x64 --self-contained trueThe binary will be output to bin/Release/net9.0/win-x64/publish/.
- Build the project (see above) or use
dotnet runvia a wrapper script. - Open your UCI-compatible GUI (e.g., Arena).
- Navigate to Engines → Install New Engine (exact menu name depends on your GUI).
- Point it to the compiled
.exe(or thedotnet runwrapper). - The GUI will issue
uciand your engine will respond — you're ready to play!
- Complete board state parsing (
positioncommand) - Implement legal move generation
- Implement minimax search with alpha-beta pruning
- Add basic material evaluation
- Add piece-square table evaluation
- Support time controls (
go movetime,go wtime btime) - Add opening book support
- Iterative deepening
Pull requests are welcome! If you'd like to contribute:
- Fork the repository.
- Create a feature branch:
git checkout -b feature/your-feature-name - Commit your changes:
git commit -m "Add your feature" - Push to your fork:
git push origin feature/your-feature-name - Open a Pull Request against
main.
Mudit Atrey — @MuditAtrey