I'm made my own version of Tic-Tac-Toe in R based on specific hardcoded custom rules. After some optimization I am now unable to improve the play. I benchmarked the bot against a random player in the following ways:
- The bot must not lose a single game
- The bot starts 50% of all simulated games
- The opponent plays by randomly choosing any open square on it's turn
When benchmarked in 100,000 games my bot wins 94.95% of the time (meaning there are 5053 tie games). Breaking it down in games where it starts the win rate is 99.49% and when it goes second it's 90.42%.
I believe that for starting the game I have reached the optimum achievable (winning 191 out of 192 games). However, I am unsure about the case when going second. The question is: What is the best any bot can achieve given the three conditions outlined above? A found a couple of papers that show that with a lot of training algorithms achieve win rates in the high eighties, so clearly this works well--just not clear if it could be improved.