Sign in to follow this  
Winterrage

MinMax and AlphaBeta Algorithm for a board game

Recommended Posts

Hi everyone, I'm a novice in the game programmation and i'm currently trying to make my first (intelligent) AI. During an Algorithm class I heard the basis of the MinMax algorithm but not enough to be able to implement one. I'd like to know if anyone have any example in Java (or any other language) or good article about it! Thanks a lot!

Share this post


Link to post
Share on other sites
You do have enough information to implement minimax. It is so natural that you can actually come up with the algorithm yourself (as I did as a teenager).

Start by making a program that considers each move available, calls an evaluation function and then picks the move that gets the best score. Call that a "depth-1 search". Now make a program that considers each move available, then does a depth-1 search from the point of view of the opponent, then picks the move that gets the best score. Call that a "depth-2 search". Turn this into a depth-n seach by using recursive functions. Ta-da! You have implemented minimax.

One of the best explanations out there is at Bruce Moreland's website.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this