AI Game playing - (Conclusion)
So, that probably looks wuite complicated, i would recomend you now download the zip file attached to this and see the whole thing in action. Remember, all you need to code to get a simple 2 player AI game playing is... A Class that...
- Holds all data on a possible game state
- knows the address of its parent
- Is capable of giving itself a score based on how favorable it is to the computer
- Can make itself a clone of its parent, then aply an operation (e.g. move X to grid 2).
- Knows how many childen it has spawned.
- Is capable of reporting its own score to its parent
- Knows when it is a terminal state
- Can grow a search tree of objects of the above class
- Can show the game state ggraphicaly
- Apply the minni-max algorithm
- Order possible next moves in order of score, and execute the state with the highest score
Comments