kz04px / 4ku

A UCI compatible chess engine that fits into 4,096 bytes.
MIT License
51 stars 20 forks source link
4kb chess

4ku

A chess engine written in C++ designed to fit into 4,096 bytes. There are two versions of the engine: 4ku, and 4ku-mini.

4ku and 4ku-mini should be identical in terms of their play, but 4ku's info strings mean it is probably slightly slower and slightly weaker. Despite this, 4ku's ease of use and cross-platform compatibility means it should probably be favoured for use in any circumstance other than being limited to 4,096 bytes.


Build Instructions

4ku can be built normally, but it won't fit into the size restriction:

git clone https://github.com/kz04px/4ku
mkdir 4ku/build
cd 4ku/build
cmake ..
cmake --build .

To build 4ku-mini on Linux, run build-mini.sh located in the root directory:

bash build-mini.sh

4ku-mini is currently unavailable on Windows.


4ku-mini Size

3,937 bytes

Requirements

4ku only needs a C++ compiler to be built and should work across platforms. 4ku-mini has the following additional requirements:

The build script, launch scripts, and compression tool (lzma) are all specific to Linux and would need replacing for 4ku to run on Windows. The code itself should be portable.


Minification

The minifier requires Python 3 to run. It's fragile and will not handle arbitrary C++ code. The minifier is not a general-purpose solution and is not guaranteed to work on non-4ku code. If better solutions are found in the future it can be replaced.

Removed:


UCI Support

4ku-mini has limited UCI support to save space:

4ku has additional support for:


Thanks