What is Alpha beta pruning? How to draw game Values From State?

64 views Asked by At

Hexapawn is a simple turn based game played on a 3 × 3 board. Each player begins with 3 pawns - WHITE (MAX) in the bottom row and BLACK (MIN) in the top row.

Pawns can move as normal in chess (i.e. white pawns can move up one square or can capture a black pawn diagonally up one square, and black pawns can move down one square or can capture a white pawn diagonally down one square). The goal of each player is to either get one of their pawns to the other end of the board, or to make it such that their opponent is stuck on their next move. Figure 1 shows the initial state of the game.

pseudo-code:

rows = 3;
cols = 3;
scale = 1;

for row in range(rows):
    for col in range(cols):
        createSquare(origin=(row*scale, col*scale), end=((row+1)*scale, (col+1)*scale))
        if row == 0:
            createBlackPawn(origin=(row*scale, col*scale), end=((row+1)*scale, (col+1)*scale))
        elif row == 2:
            createWhitePawn(origin=(row*scale, col*scale), end=((row+1)*scale, (col+1)*scale))

Show the value of the game from the state using Alpha-Beta pruning. Mark any branches that will be pruned, and show what the bounds on the payoffs are for each player at each state not pruned.

From This state of game

0

There are 0 answers