A minimax chess engine in regular expressions
11–20 of 103 posts
Re: A minimax chess engine in regular expressions
#12I normally don’t lose so quickly opening with a2a4 !
I encountered similar bug in the a-column via e2e4-d2d4-d1d4-g1f3-f1b5-d4e5-e5c5-e1g1-b2a3
Re: A minimax chess engine in regular expressions
#13Re: A minimax chess engine in regular expressions
#14a2a3 gives me illegal move game over. What am I missing here?
Bad news if you're almost done with a game and enter a move with the wrong case.
Re: A minimax chess engine in regular expressions
#15a2a3 gives me illegal move game over. What am I missing here?
Somewhat surprisingly (given the creator's regex chops) capital letters are not accepted. My guess is that your autocorrect changed the move to A2a3. Bad news if you're almost done with a game and enter a move with the wrong case.
Re: A minimax chess engine in regular expressions
#16Re: A minimax chess engine in regular expressions
#171. e2e4, e7e5 2. d2d4, e5d4 3. d1d4, a7a5 4. g1f3, b7b5 5. b1c3, a5a4 6. c3b5, a4a3 7. b5a3, a8a3 8. b2a3 --> Illegal Move You Lose. Game over.
FEN of game above: 1nbqkbnr/2pp1ppp/8/8/3QP3/P4N2/P1P2PPP/R1B1KB1R b KQk - 0 8
Re: A minimax chess engine in regular expressions
#18Compare also https://codegolf.stackexchange.com/q/3503/32575
Re: A minimax chess engine in regular expressions
#19There's a bug somewhere it seems like, as it ends the following game with "Illegal move, you lose", even though it's not an illegal move: 1. e2e4, e7e5 2. d2d4, e5d4 3. d1d4, a7a5 4. g1f3, b7b5 5. b1c3, a5a4 6. c3b5, a4a3 7. b5a3, a8a3 8. b2a3 --> Illegal Move You Lose. Game over. FEN of game above: 1nbqkbnr/2pp1ppp/8/8/3QP3/P4N2/P1P2PPP/R1B1KB1R b KQk - 0 8
Re: A minimax chess engine in regular expressions
#20Compare also https://codegolf.stackexchange.com/q/3503/32575
That shouldn't be really surprising, as all divisibility rules are necessarily regular because anything more complex wouldn't be human-executable "rules".
In any case, if you know how the regex is constructed, it's not surprising. But I found it fun to actually do the construction, instead of just being theoretically aware of the possibility.