0

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

virolino
  • 2,073
  • 5
  • 21
nifty khan
  • 57
  • 2
  • 9
  • Please show what your current approach is and what problems you are facing. – Yanick Salzmann Oct 09 '20 at 05:33
  • i just need to show the values from current state and perform alpha beta – nifty khan Oct 09 '20 at 05:35
  • @YanickSalzmann i update the question – nifty khan Oct 09 '20 at 05:36
  • Yes, but we are not here to do your homework. You start solving the problem, put some code here and explain where you are stuck and we can give you hints how to proceed. – Yanick Salzmann Oct 09 '20 at 05:37
  • i dont need to write code for that i write pusdocode i will put it . – nifty khan Oct 09 '20 at 05:37
  • there are 3 part i solve first 2 this is the last part to perform alpha beta which i dont know how so i need help for this. – nifty khan Oct 09 '20 at 05:39
  • You should write more general pseudocode. The "For in" for loop style is acceptable to be written in general pseudocode. However, its combination with "if elif" conditional statement and "range()" function call has fooled us. Because it's looks like python code. Your pseudocode seems specific to python. Therefore, you should consider to add python tag or write more general pseudocode. – Willy satrio nugroho Oct 09 '20 at 07:38

0 Answers0