Getting started with IronPython – Part 4: MiniMax algorithm

Dror Helper continues his series on getting started with IronPython programming. He has been creating an example game and after his last entry on unit testing he moves onto adding some simple AI logic:
As part of my quest to learn how to program in Python I’ve decided to implement a simple Minimax algorithm.

The algorithm is simple and relies on a elementary principle – each turn you will choose the best move and your opponent will choose the worst move for you. By building a search tree with a limited depth we can then choose each time either the maximum result possible or the minimum result according to the player’s turn.

You can read more about Minimax algorithm in Wikipedia – or continue reading and learn it from my implementation.

Comments

Popular posts from this blog

Extending Abobe Flash Player and AIR with Python and Ruby

Should Python Projects Support IronPython and Jython?

Further Adventures of the Debugger