tags:

views:

30

answers:

1

Firstly I would like to accept that it is a homework question , but then I know how to code AB-pruning from the algorithm of it . The problem is how to apply it on a grid of numbers where the game can go on in any direction (right , left , up and down ) , thus how will be the tree formed .

Sorry for being a bit vague here , if more info is required then do inquire , I will provide it .

+2  A: 

You question is very vague so I can only guess what you are asking:

Are you talking about a game where the player can only move in one of those 4 directions on each turn? If that is the case, your Node will be an (x, y) position of your player on the grid, and each node will branch 4 times (once for each direction) plus maybe 1 if you can stay still.

You say you already know how to code AB-pruning, so is that enough?

Peter Alexander
Your answer is a bit helpful in visualizing as to how to do it . thank you .
mekasperasky