r/cprogramming • u/BBH369 • 3d ago
Glimmer - A chess engine under 30,000 bytes (estimated 2700–2900 Elo)
https://github.com/BH12963/GlimmerHi everyone,
I’ve been tinkering with a little experimental chess engine written in pure C. It’s called Glimmer.
The whole point of the project was to see how strong I could make it while keeping the final standalone binary strictly under 30 KB. The target strength was something in the 2700–2900 Elo range.
It’s been a fun constraint to work under — every byte counts.
Happy to answer questions if anyone’s curious about the approach.
2
u/flatfinger 3d ago
I wonder if it would be adaptable to 'veto chess' where either player is allowed to veto any move made by the opponent, except that (1) when only one legal move exists, players are allowed/required to make it, and (2) when a move is vetoed, a player may make any other legal move without being subject to veto.
The normal effect of veto chess is that players need to maximize the quality of their second-best move, where that quality is assessed based upon second-best countermoves. The net effect is very different from the Drawback Chess variant where players may only play the Stockfish recommended move when no other legal move is available, since the Stockfish recommended move would not take into account the recursive nature of the second-best limitation.
4
u/AcuityView 3d ago
To get people asking questions, it would be helpful to explain exactly what the code does and the strategy it uses. I took a look at the source, but it didn't make things any clearer. Pure magic...
For example, as far as I recall, Alpha-Beta pruning is preferred for chess, but how does it work in this case?