Re:Can You Beat This Game?
by integraleq on Sunday September 12, 2010 @11:27PM
(#1685399)
You are correct about the representation, but I went for the most low-scale approach since the search space is so small. The next version will learn how to build its own rules, but that is for another day. Thanks for all of your help though. I really appreciate it.
You're encoding the game state as a giant switch statement. This is not the best approach. The size of your code will increase exponentially with the complexity of the game. The only reason it works at all is because tic-tac-toe is very simple. You should read up on representing this as a game tree:
http://en.wikipedia.org/wiki/Game_tree http://en.wikipedia.org/wiki/Extensive-form_game
Here was my first run, pretty much randomly choosing boxes:
Hope that is helpful.