Game trees and minimax -- tic-tac-toe
Author |
Message |
Null
|
Posted: Sat Mar 31, 2007 7:14 am Post subject: Game trees and minimax -- tic-tac-toe |
|
|
I was going to do this on my own time, but I was just recently assigned a final project, so this will be for school.
I want to attempt to write a minimax algorithm for a game of tic-tac-toe. I've found some basic tutorials describing the algorithm, but I was wandering if anybody had some more comprehensive references to share.
My plan:
- Program the basic framework for creating a board and interacting with it. -- Done
- Program the basic tree generation without considering reflections.
- Check for reflections and significantly reduce size of tree.
- Write/research an algorithm to rank tic-tac-toe states based on probability of winning.
- Write minimax algorithm and apply it to tree.
Now, I know very little about what I'm doing in this area, so does anyone see any problems that I may encounter? Does this seem like a good plan thus far?
Advice would be really appreciated.
PS. I forgot. The project is in Java, but I'm going to initially write it in Ruby for fast(er) development. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Drakain Zeil
|
Posted: Sat Mar 31, 2007 8:22 am Post subject: RE:Game trees and minimax -- tic-tac-toe |
|
|
Since TTT is a game where all moves can be decided, have the game recurs all movies to all solutions from it's current game state. Return with the best move.
You can optimize this concept. |
|
|
|
|
|
klopyrev
|
Posted: Sun Apr 01, 2007 2:52 am Post subject: Re: Game trees and minimax -- tic-tac-toe |
|
|
Are you doing just a basic 3x3 tic tac toe or other board sizes too? Writing a minimax algorithm shouldn't be too hard for Tic Tac Toe. If you encounter any problems along the way, feel free to ask questions. As for your plan: if you choose to counter for reflections, it will make it faster, but it was affect it so little that you probably won't notice it. You should search for alpha beta pruning instead. Also, if you search for recursion on google, you fill find tons of sites explaining how to do recursion. Many of them will even explain how to program Tic Tac Toe.
KL |
|
|
|
|
|
|
|