Show HN: Sameshi – 一个大约 1200 Elo 等级的国际象棋引擎,大小在 2KB 以内。
Show HN: Sameshi – a ~1200 Elo chess engine that fits within 2KB

原始链接: https://github.com/datavorous/sameshi

一个支持游戏受限子集的最小化国际象棋引擎。sameshi.h: 1.95 KB,120个单元的邮箱棋盘,Negamax搜索,Alpha-Beta剪枝,仅材料评估,先手捕获,完整的合法着法验证(将/杀/僵局)。未实现:王车易位,吃过路兵,升变,重复局面,50步规则。~1170 Elo (95% CI: 1110-1225),与Stockfish (1320-1600等级)对弈240局,固定深度5,受限规则,最大60步。

## Sameshi:一个2KB的国际象棋引擎 开发者datavorous最近分享了“Sameshi”,这是一个令人印象深刻的国际象棋引擎,代码压缩到仅2KB。Sameshi基于Negamax算法和alpha-beta剪枝构建,使用120个单元的“邮箱”来表示棋盘,并包含将杀/逼和判定。 受到demoscene(一种计算机艺术亚文化)的启发,创作者旨在实现极致的代码最小化。为了评估其棋力,Sameshi在不同的Elo等级(1320-1600)下与Stockfish进行了测试,结果估计其Elo等级约为1200。 评论者对代码尺寸的成就表示钦佩,其中一人询问了代码的可读性——暗示为了达到如此小的体积,代码可能经过了大量的混淆。该项目可在GitHub上找到 ([github.com/datavorous](https://github.com/datavorous))。
相关文章

原文

A minimal chess engine supporting a constrained subset of the game.

sameshi.h: 1.95 KB

  1. 120 cell mailbox board
  2. negamax search
  3. alpha beta pruning
  4. material only eval
  5. capture first move ordering
  6. full legal move validation (check / mate / stalemate)

Note

not implemented: castling, en passant, promotion, repetition, 50-move rule.

~1170 Elo (95% CI: 1110-1225)
240 games vs stockfish (1320-1600 levels)
fixed depth 5, constrained rules, max 60 plies.

联系我们 contact @ memedata.com