Skip to content

Karuso1/LegalMiniUCI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

LegalMiniUCI

LegalMiniUCI is a simple, single-file chess engine written in C, designed to support the UCI (Universal Chess Interface) protocol. It features iterative deepening, alpha-beta pruning, and basic evaluation with material and positional heuristics.

Note: This engine is still in development. Features, evaluation, and performance may change as the project evolves.

Features

  • Singe-file C implementation
  • Supports UCI protocol
  • Iterative deepening up to user-defined depth.
  • Alpha-beta pruning for efficient search
  • Simple evaluation with:
    • Material values
    • Piece-square tables(PSTs)
    • Mobility and positional considerations
  • PV (principal variation) printing in UCI style
  • Cross-platform: works on Windows, Linux, macOS
  • Configurable search depth

Getting Started

You can compile manually using your VS Code terminal or any C compiler:

# Using GCC (on Linux / macOS)
gcc -O2 -Wall -Wextra -std=c11 legalminiuci.c -o legalminiuci.exe

# Using MinGW on Windows
gcc -O2 -Wall -Wextra -std=c11 legalminiuci.c -o legalminiuci.exe

For debugging, you can add -go O0 instead of -O2

Run

./legalminiuci.exe   # Linux/macOS
legalminiuci.exe     # Windows

Then connect it to any UCI-compatible GUI like Arena, Cute Chess, or ChessGUI.

UCI Commands

  • uci – Initialize UCI mode
  • isready – Engine readiness check
  • ucinewgame – Start a new game
  • position [fen ...] moves ... – Set position and moves
  • go [depth ...] [nodes ...] [movetime ...] [wtime ...] [btime ...] – Start search
  • quit – Exit the engine

Example Usage in GUI or terminal:

uci
isready
ucinewgame
position startpos moves e2e4 e7e5
go depth 5

Notes

  • Depth 5 works smoothly for normal hardware.
  • Engine is single-threaded and designed for simplicity and education.
  • For VS Code users, just open the terminal in the folder with legalminiuci.c and run the GCC command above.

About

A single file chess engine, still under development.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages