Regex Chess: A 2-ply minimax chess engine in 84,688 regular expressions
nicholas.carlini.com
Regex Chess: A 2-ply minimax chess engine in 84,688 regular expressions
1–10 of 56 posts
Re: Regex Chess: A 2-ply minimax chess engine in 84,688 regular expressions
#2This is like a fever dream.
Re: Regex Chess: A 2-ply minimax chess engine in 84,688 regular expressions
#32025
Re: Regex Chess: A 2-ply minimax chess engine in 84,688 regular expressions
#4The technical write up is worth perusing but I played a game before reading and accidentally found a winning strategy immediately. I'm not sure if this is a result of the 2-ply nature of the engine or if the mentioned deficiencies account for this but the computer did not act to prevent checkmate in 1 (without any intervening check); the game I played was (in algebraic notation):
1. e4 e5
2. kf3 kf6
3. kxe5 kxe4
4. d4 kxf2
5. Kxf2 a5
6. Qf3 b5??
7. Qxf7
1-0
Re: Regex Chess: A 2-ply minimax chess engine in 84,688 regular expressions
#5This is amazing. I'm at loss for words.
During my CS years I remember being fascinated by NFA's, as opposed to boring single universe DFA's.
For some reason I internalized that I would never see something like an NFA implemented beyond text books.
Then came Carlini.
Re: Regex Chess: A 2-ply minimax chess engine in 84,688 regular expressions
#6This is amazing. I'm at loss for words. During my CS years I remember being fascinated by NFA's, as opposed to boring single universe DFA's. For some reason I internalized that I would never see something like an NFA implemented beyond text books. Then came Carlini.
But... they are equivalent?
Re: Regex Chess: A 2-ply minimax chess engine in 84,688 regular expressions
#7Upon reading the title, this is one of those "I know that's possible, but I'd never bother to implement it" things, although this particular implementation isn't exactly what I had in mind.
Re: Regex Chess: A 2-ply minimax chess engine in 84,688 regular expressions
#8[deleted]
Re: Regex Chess: A 2-ply minimax chess engine in 84,688 regular expressions
#9This is absurd. I did not realize you could do nearly this much computation in regex.
Re: Regex Chess: A 2-ply minimax chess engine in 84,688 regular expressions
#10This is absurd. I did not realize you could do nearly this much computation in regex.
It’s turing complete so you could compile almost any language to regex. You might have to build a vm for some languages, also in regex. The point is, it’s regex all the way down.