This commit is contained in:
Miloslav Ciz 2024-12-12 21:58:18 +01:00
parent baca171ff8
commit 997823cb0d
23 changed files with 1896 additions and 1873 deletions

View file

@ -32,3 +32,5 @@ PGN: 1. e4 e5 2. d4 d5 3. dxe5 dxe4 4. Qxd8+ Kxd8 5. f3 exf3 6. Nxf3 Ke8 7. Nc3
Technical details: it's no [stockfish](stockfish.md), simplicity is favored over strength. Evaluation function is hand-made with 16 bit integer score (no [float](float.md)!). Board is represented as an [array](array.md) of bytes (in fact it's an array of [ASCII](ascii.md) characters that can conveniently be printed right out). AI uses basic [recursive](recursion.md) minimax and alpha-beta pruning, with quiescence handled by extending search for exchanges and checks. For simplicity there is no transposition table, opening book or similar fanciness, so the performance isn't great, but it manages to play some intermediate moves. Xboard is supported.
While there are many high level engines focusing on maximizing playing strength, there are almost no seriously simple ones focusing on other points -- smallchesslib/smolchess tries to change this. It can be used as an educational tool, a basis for other engines, a simple engine runnable on weak devices, a helper for processing standard chess formats etc.
{ Although I think it would be possible to increase the playing strength a lot considering there are extremely simple engines that reach much higher Elo, TBH I am still a noob at chess programming and I suspect I have some kind of oversight in the algorithm, perhaps something related to the horizon effect. The AI doesn't make obvious blunders like hanging pieces so it's not easy to pinpoint what exactly should be improved, perhaps it's just tuning of the evaluation function or low number of searched nodes -- I have quickly tried to do things such as tuning of the parameters, adding opening book or transposition table, but it never seemed to detectably increase playing strength, and I also don't have a [modern](modern.md) computer that would allow me to do hardcore bruteforce tuning, my computational resources are limit. If someone experienced discovers what's the thing to improve, I'd be very glad, thank you. ~drummyfish }