Jump to content
  • Advertisement
Sign in to follow this  
Winterrage

MinMax and AlphaBeta Algorithm for a board game

This topic is 3893 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!