resell4 at March 14th, 2012 12:42 — #1
I bet most of you in here have seen the old movie "Wargames"
Im wondering how would you go about programming an AI like WOPR that learns from itself?
Lets take an example in chess *Which he loved* He would make simulations of a chess game, if he lost he would learn from the mistake and improve from that the next time.
stainless at March 16th, 2012 06:41 — #2
Read up on genetic algorithms
In principle you can view the simulation as something like this.
Create an evaluation function for each move.
Play the game using a search algorithm using the evaluation function to pick the best move
Evaluate the results
Then you have to come up with a new evaluation function.
Typically you generate N random evaluation functions, run them all, pick some of the best ones and "breed" them together to create another N evaluation functions, rinse and repeat.
The breed phase is the interesting bit of code for me.