Representation and heuristic of Connect6 game in Prolog

I want to introduce a connect6 wiki game (possibly a predicate stone (P, X, Y), where P is the player, X, Y are the coords for good). I also want to use any good heuristic to solve the problem (to make the adversary). Can you give me a hint for any article about playing AI in Prolog? Thanks

+4
source share
2 answers

You will probably want to see http://en.wikipedia.org/wiki/Minimax . To optimize your search, you probably do not want to consider all possible actions. Maybe itโ€™s just moving, which corresponds to the existing part and 6 or fewer spaces from it.

Then you will need http://en.wikipedia.org/wiki/Evaluation_function . It is likely something like assigning a rating of "how close I am to the end of the line" as a whole in the lines.

Creating and optimizing a game tree is more of a mechanical process. Creating a rating function is an interesting part that will give your opponent an unique taste.

A google search for the โ€œminimax prologue game treeโ€ brought up a nice powerpoint: http://staff.science.uva.nl/~arnoud/education/ZSB/2009/

+2
source

If you use Connect6 on the final board, then a possible view for this game would be a list of lists of variables that were originally unrelated. You "place the stone" by combining the variable with one of the black or white atoms. Then you can check if the position of P remains empty with var(P) . This view should be much faster to manage than the stone/3 terminology list. This works because in Connect6 you can never remove a stone.

I assume that by heuristic you mean a rating function suitable for minimax, negamax, or alpha beta search. Given the rules of the game, I would suggest that for each player you count the number of lines five in length and rate them 5, evaluate them four four in length, etc. This gives you two indicators S 1 and S 2 . Subtracting S 2 from S 1 gives a relative advantage for player 1. Then find a way to normalize them in the range [-1,1] or compare the situation when the game is at infinity minus infinity. (How to imagine everything that remains in the Prolog as an exercise.)

+2
source

All Articles