Wargames WOPR AI?

1322d323fddaced32fbb2af492af35b1
0
resell4 101 Mar 14, 2012 at 16:42

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.

1 Reply

Please log in or register to post a reply.

B5262118b588a5a420230bfbef4a2cdf
0
Stainless 151 Mar 16, 2012 at 10:41

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.