Well, if the game would be changed to disallow 'moves' in won sections, you'd have a completely different game where this 'exploit' of opponent trapping does not work.
The first one is beatable if -- and only if, I believe -- a square with two three-in-a-rows in it counts as both an X and an O. If this is the case, then O can win one round before X has a chance to it. But otherwise -- as you have it configured, where the first to get a three-in-a-row sets the larger square to either an X or an O -- it's unbeatable.
There are definitely bugs- I played the 2nd link and on several moves the AI moved in the wrong region. I played in the SW block in the E square and then the AI played in the same SW block as me, then did the same thing on the next turn playing in the wrong region.
Could it be because of the rules variation? See the comments on rule 5b to negate Perfect Bot's strategy: if forced to an already-won region, the player may choose any region.
Re:Ultimate Tic Tac Toe
by triangleman83 on Tuesday June 18, 2013 @07:19PM
(#5902679)
Yep I don't see any way of beating that bot. You whipped that up just today?
The KA folks were playing this in the office a few weeks back, James wanted to make a good AI for it, spent a weekend or so on it, and discovered the Perfect Bot in the process. My sole contribution to this program (in addition to moral support!) was creating a copy that's set to Perfect Bot by default for y'all's convenience, but his original has all sorts of crazy config.
Does the AI always have to make the first move?
For Perfect Bot's strategy to work, yeah, but the environment is very open to configuration. Set xIsComputer to false and yIsComputer to "monte" for a fun challenge in which you go first.
And here's James Irwin's original implementation, auto-set to a Monte-Carlo AI and with a rules variation that (to my knowledge) prevents Perfect Bot from winning. Play with the config variables at the top for some other AIs and 2-player games and whatnot. https://www.khanacademy.org/cs/in-tic-tac-toe-ception/167633...