A minimax chess engine in regular expressions
41–50 of 103 posts
Re: A minimax chess engine in regular expressions
#42This point was where this changed from crazy/fun to absolutely extraordinary, where calculations of multiple possible positions all occurred in parallel, running a regex over an increasing series of state & variable sets, aka threads: > And now for my absolute favorite part of the language we've developed. By the magic of regular expressions (and the fact that they perform substitution globally over the entire string…
For me what I take out of it is the power to sit down, focus your mind on something then who knows the lengths of what is possible. That, and the author is clearly very talented/skilled and creative.
Re: A minimax chess engine in regular expressions
#43What about directly encoding the rules of the game plus some basic strategy?
Re: A minimax chess engine in regular expressions
#44Re: A minimax chess engine in regular expressions
#45Earlier quoted context omitted.
Humans can't see the balance at a glance, but we can still easily check the balance of arbitrarily complex nested parenthesis because we are not limited in the same way an FSM is. We're just way way way slower than a computer.
Yeah, I agree that humans can indeed check some non-regular languages. That doesn't however mean that humans are inherently capable for checking all non-regular languages, as they are severely limited in the working memory size. Most if not all divisibility rules are a set of least significant digits or weighted running sums because they are subject to the same constraint, so they are indeed necessarily regular.
Re: A minimax chess engine in regular expressions
#46Earlier quoted context omitted.
> demonstrated that printf() is Turing complete and wrote a first person shooter in ... Not gonna lie, I thought that sentence would end with the FPS being done in printf.
This guy wrote tic-tac-toe in a single call to printf for IOCCC 2020 competition: https://github.com/carlini/printf-tac-toe
Re: A minimax chess engine in regular expressions
#47I do think there are some bugs based on playing a game against it. It has a tendency to give up its queen and other pieces. and it blundered mate in 1 at the end of the game when it had moves that led to mate in 2 or 3.
Usually even a 2-ply engine should avoid these mistakes unless the evaluation function is completely silly, which may be the case here, I don't know. I tried looking at the code but it didn't make much sense to me, I'm not smart enough to understand this regex "runtime" based code. Could also be a bug of using somewhere, or vice versa, making it choose the worst move instead of the best one.
Re: A minimax chess engine in regular expressions
#48Re: A minimax chess engine in regular expressions
#49This point was where this changed from crazy/fun to absolutely extraordinary, where calculations of multiple possible positions all occurred in parallel, running a regex over an increasing series of state & variable sets, aka threads: > And now for my absolute favorite part of the language we've developed. By the magic of regular expressions (and the fact that they perform substitution globally over the entire string…
This makes me wonder whether I could achieve such a thing if I removed all my preoccupations of other stuff. For me what I take out of it is the power to sit down, focus your mind on something then who knows the lengths of what is possible. That, and the author is clearly very talented/skilled and creative.
Re: A minimax chess engine in regular expressions
#50Earlier quoted context omitted.
This guy wrote tic-tac-toe in a single call to printf for IOCCC 2020 competition: https://github.com/carlini/printf-tac-toe
It’s very fun and impressive but it’s absolutely not a single call.
There is only a single printf written in the source code.