-
Connect 4 Headachev
Hey all,
I'm programming a player class to plug into Connect 4 application (GUI) using the minimax algorithm.
I have most of my code already and I would like to post it but it is sitting at just under 400 lines at the moment.
The problem I have lies with one of my evaluation functions. After that, my minimax could do with some help too.
For my evaluation function, it further calls two methods, one checks a column, the other checks a row. I have no idea which one of these two methods is wrong or whether they are both wrong. So I have tested it by commenting out the second method.
The first method appears to be the problem:
This happens: although I set the code up to terminate when it gets to row index 5 on the board grid, I have guards to check this as well, the program still wants to proceed to row 6 for some reason.
I've checked my variables so many times, but I can't find anything wrong.
Also, my minimax code only seems to work if I am in the MIN player, if I set myself as the MAX player, it falls over.
I used the minimax algorithm at ai- depot.com. The MIN and MAX methods that are called by method MINIMAX are very similar, so I don't think the error lies in method MAX... but then who knows, I've probably missed something as per usual
I would really appreciate some assistance, I have most of the code so I am not asking for someone to do my homework.
If you are interested in helping me, I would send my code over and maybe we can discuss it over Messenger or something.
Thanks in advance.
burberry.
Similar Threads
-
By viranganalaka in forum Java
Replies: 1
Last Post: 05-12-2006, 03:35 AM
-
By James in forum VB Classic
Replies: 2
Last Post: 08-30-2001, 12:47 PM
-
By Chris.G in forum VB Classic
Replies: 4
Last Post: 11-13-2000, 03:16 PM
-
By Chris.G in forum VB Classic
Replies: 0
Last Post: 11-12-2000, 11:03 PM
-
By SweeYeun in forum VB Classic
Replies: 0
Last Post: 05-16-2000, 10:30 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks