Home » Forum Home » Development

Topic: Writing a pente AI
Replies: 2   Views: 28,327   Pages: 1   Last Post: May 21, 2009, 2:14 PM by: alisontate

Search Forum

Back to Topic List Topics: [ Previous | Next ]
Replies: 2   Views: 28,327   Pages: 1  

Posts: 8
Registered: Feb 6, 2007
From: CA, U.S.A.
Age: 30
Writing a pente AI
Posted: Mar 13, 2009, 11:12 PM

Hi all, but especially Dweebo and Mark Mammel,

I teach a high school programming class part-time, and for an upcoming class project I am considering a pente game. The students already have a GUI framework provided for them that handles images in a grid fairly well (see http://www.horstmann.com/gridworld). In writing their game, I would like to have the students implement a simple AI to play against.

I could brush up on general turn-based strategy algorithms, and then apply them to pente to write the project demo. But frankly, I can only spend so much time on my part-time job, and I don't have the time to try several different approaches before settling on a decent one that isn't too much coding for my students to handle.

So, can anyone point me to any resources for this effort? I'm looking for outlines for existing AI algorithms that are known to work reasonably well without massive coding. Or even the source code to an AI which I can pare down for my students. Or any other pointers.



Posts: 2,216
Registered: Mar 4, 2007
From: San Francisco
Age: 43
Home page
Re: Writing a pente AI
Posted: Mar 14, 2009, 1:16 AM

your link has a incorrect ). at end of it

http://www.horstmann.com/gridworld/ .

/ <--yes no--> )


Scire hostis animum - Intelligere ludum - Nosce te ipsum - Prima moventur conciliat - Nolite errare

Posts: 157
Registered: Nov 27, 2008
Age: 30
Re: Writing a pente AI
Posted: May 21, 2009, 2:14 PM

Hi tarcellius,

dont know if you have had any luck since your post but there are plenty of examples of algorithms on-line.

I expect you know this already, but what you need is a simple minimax algorithm with alpha-beta pruning. You could get fancy with aspiration windows, transposition tables and singular extensions, but for students minimax + pruning would be enough. I designed a chess playing game at University (someone else did the actual programming for me) and found you could get something basic to work in a couple of months.

With a lot of games the hard work is actually in the efficient evaluation of leaf nodes. In chess you can get by almost entirely on adding up the piece values, and scores for King danger, checks and simple threats, open rook files, advanced pawns to make a pretty good program. The trouble with Pente will be that unless you get some advice from experts like Mark Mammel you will have to come up with criteria for evaluation all on your own, which may take a long time to perfect.

Anyway, its May and you posted in March so this is probably too late for you. But anyway I hope this helps!

Good luck

Replies: 2   Views: 28,327   Pages: 1  
Back to Topic List
Topics: [ Previous | Next ]

Powered by Jive Software