mathspp
  • Blog
    • Pydon'ts
    • Problems
    • TIL
    • Twitter threads
  • Books
  • Talks
  • Trainings
    • Advanced iteration
  • Courses
  • About
Link blog

Regex Chess: A 2-ply minimax chess engine in 84,688 regular expressions

by Nicholas Carlini on 10-01-2025 15:25 (via)

At the top of this article you are presented with a very basic rendering of a chess board and an input field where you're supposed to type chess moves:

Although this chess engine isn't very smart, since it fell for the Scholar's mate after checking me with a rogue bishop, the part of the engine that is computing what move to play is a series of 84,688 regular expressions... The full explanation of how the engine works is brilliant and is available immediately under the chessboard. For reference, I did beat the engine when I played 5. Qxf7#:

Previous link Next link

If there is a 50% chance something will go wrong, then 9 times out of 10 it will.

mathspp
  • Blog
    • Pydon'ts
    • Problems
    • TIL
    • Twitter threads
  • Books
  • Talks
  • Trainings
    • Advanced iteration
  • Courses
  • About