views:

795

answers:

5

In my data structures class, we've been assigned a project in which we are required to make a fully functioning Quantum Tic Tac Toe game in which a player faces a bot that plays to win.

The professor suggested we use a game tree in our AI. However, as usual, I am looking for something more challenging.

Can anyone suggest a better, more advanced approach that I could research and implement?

Thanks!

Edit: I'm not looking for something completely ridiculous that makes the problem more complex. Rather, I'm looking for an advanced approach -- like using an A* algorithm rather than a BFS.

A: 

To provide a learning feature to your implementation, you may look into an emulator for Donald Mitchie's MENACE (Matchbox Educable Noughts And Crosses Engine)...

Edit:
In looking into it, this has been done quite a bit, see for example this on CodeProjet
Furthermore, and while acquiring a statistical model of the world (or here of the Tic-Tac-Toe reduced world) and basing future actions upon such a model is intelligent behavior, it may be considered out of scope by your professor, because not touching key concepts you probably covered in class (knowledge representation, decision trees...)

mjv
That just makes the problem more complicated, because if you create a learning tic-tac-toe machine, you're obliged to give it voice synthesis and the ability to talk like WOPR from *WarGames*
Jherico
How about using the GenPro kit to create a self-learning TicTacToe game based on genetic algorithms? You would not have to train it by hand, just let it fester for a while. O yeah, and of course come up with a useful 'DNA' encoding for your game's strategy and a fitness function but that should be doable - and impressive.
Adriaan Koster
+2  A: 

Impress your professor by implementing patterns and real-OO code instead of boring lengthy if/else blocks in one large method block. As it's a strategy game, start with the strategy pattern. Also try to care every element as an fullworthy Object with properties and methods. That's your strategy for now.

BalusC
I own design patterns, and I've read it cover to cover. I've implemented common design patterns ( namely singleton, strategy, and factory) in every project so far.
dacman
+2  A: 

There are 2 parts to evaluating a turn based game.

  1. The game tree.
  2. A utility function.

The game tree allows you to play out moves ahead of time to see where they will lead. If the game is complex enough that you cannot compute all possibilities (http://en.wikipedia.org/wiki/Solved%5Fgame), then you need a way of determining how "good" a particular board scenario is. A poor utility function for chess might simply count piece values and ignore position.

You also need an efficient way of traversing the game tree. Read about Minimax, Alpha-beta pruning, Negascout, etc.

z5h
These suggestions were provided by the professor. I'm wondering if there is something above and beyond that I could implement.
dacman
Clean code, good design, using the techniques discussed. Have you already done all of that and want to do more?
z5h
+5  A: 

Your desire to learn new things (on your own even) is good. However a complicated solution is often not the best solution.

There is a very good reason your professor suggested using a game tree for the AI. It's suggested because its the right tool for the job. There is not a better approach that you can research because it is the best approach.

You mentioned that you're in a data structures class (which is usually a first or second year class). I'm guessing that the point of your assignment is to learn about tree data structures. If you want to make things more complicated, write the tree version first and then go and research other ways of solving the same problem.

David Locke
+1 because now I have the phrase to say to my self, 'gloves'
instanceofTom
I'm not looking for a more complicated solution. I'm looking for the best solution. In the past, my professor has given suggestions such as "use BFS to solve the problem", yet BFS wasn't the optimal solution. Rather, A* was. I'm simply looking for the best solution. If a game tree is the best solution, then so be it.
dacman
+1  A: 

I'm actually working on this specific problem right now: http://www.rickb.com/quantum-tic-tac-toe

I had considered doing something more advanced as well, but I'm just sticking to the good ol' alpha-beta search algorithm. My main problem is coming up with a good algorithm to "score" each particular board state. QTTT is much more complicated than standard tic tac toe, the number of states to search is exponentially larger. I have the full standard tic tac toe game tree in memory which I use to quickly look up the score for each "classical" board state, but then I have to somehow score the superposition state. The number of states is so large that you can't go too deep in the tree so an appropriate scoring function to prune the tree early is a must.

Richard Burgess
That's all you need. I didn't really know anything about AI going into this project and assumed that my professor was -- as usually -- giving us the easiest approach.
dacman