3 ms·
Here's an implementation that pretty much does exactly that. If someone can beat this bot, lemme know: https://www.khanacademy.org/cs/in-tic-tac-toe-ception-per
by matchu 13y ago
Here's an implementation that pretty much does exactly that. If someone can beat this bot, lemme know: https://www.khanacademy.org/cs/in-tic-tac-toe-ception-perfect/1681243068 https://www.khanacademy.org/cs/in-tic-tac-toe-ception-perfec...
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/1676336506 https://www.khanacademy.org/cs/in-tic-tac-toe-ception/167633...
- nkoren 13y agoThe 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.
- triangleman83 13y agoYep I don't see any way of beating that bot. You whipped that up just today?
- matchu 13y agoThe 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.
- tensaix2j 13y agoDoes the AI always have to make the first move?
- gcb0 13y agoTechnically a game of tic tac toe is comprised of two matches, one each player starting
- matchu 13y agoFor 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.
- deleted 13y ago[deleted]
- deleted 13y ago[deleted]
- WarDekar 13y agoThere 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.
- matchu 13y agoCould 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.
- NKCSS 13y agoWell, 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.