-
Connect 4 AI help!
I need help in making a AI for my connect 4 program. Specifically it's not just any connect 4, but to win, you must get a L shape.
(ie. ***) . I am trying to figure out how to make a recursive method to give me the next best possible move based on the move depth.
*
Having trouble figuring out the point system, and how to know if a move is better than another. Also maybe a general outline of how I should achieve this.
Any help would be appreciated.
-Billy
-
Re: Connect 4 AI help!
Google for the 'mini-max', 'alpha-beta pruning' or 'Shannon A', 'Shannon B' methods; they all try to find a 'best' move in a game tree (recursion!) and an evaluation function.
kind regards,
Jos
-
Re: Connect 4 AI help!
Hmm, after looking at it, i'm not too sure on how to import past moves into play. In this program, the human player always goes first. Lets say after the computer makes the 2nd move, how would it test for all moves excluding the one's that are already filled out?
maybe say at that spot, if it's not white, increment the column?