How to get started with MINIMAX for my Connect Four Clone,
Members - Reputation: 104
Posted 26 June 2012 - 09:05 PM
So I decided to implement the MINIMAX tree, with a simple pruning algorithm. As I have no experience in this area, and only have a general idea of MINIMAX, could I get some help? I under stand the basic premise of the algorithm, yet I cannot seem to get an idea of how to implement this.
I have an array holding the play field data, 0 being empty, 1 being the player, and 2 being the computer. Player one goes first. And the loser goes first the next game. Regardless, I have no idea on how to start implementing this.
Would I hold an array of the play field for each possible move? Or would I have an array for a set of moves and score that array? I guess the latter would save a lot of memory,
Then, would I use a for loop on each set of moves to create an array for a different move? Then check to see if that move is a win or lose, and if not, do it again?
I guess what I am looking for is a very simple pseudo code version of what I have to do.
Thanks for your help guys.