ACHI Game Assignment: Implementing a MinMax Algorithm for a Two-Player Board Game - Prof. , Assignments of Computer Science

An assignment to develop a system for playing the game 'achi', which is similar to tic-tac-toe but with some additional rules. Students are required to implement a minmax algorithm with a static board evaluation function and a generate moves function. The game is played on a 3x3 board, and players take turns placing and moving their pieces. Instructions, rules, and hints for completing the assignment. Extra credit is offered for implementing alpha-beta pruning.

Typology: Assignments

Pre 2010

Uploaded on 08/17/2009

koofers-user-krp
koofers-user-krp 🇺🇸

4.3

(3)

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Game Assignment
Due: November 4
Game
You are to implement a system that is capable of playing the game 'achi' against another opponent. The
hardest part of the whole assignment will be making it through these instructions, so get ready.
Rules
ACHI is a game very similar to tic-tac-toe. It is played on a 3 x3 board. Each player begins with 3 pieces
(X's and O's for example). Players take turns placing their pieces on the board. Players decide who goes
first. The first player puts a stone (or x) on any point on the board, except the center point. Players then take
turns placing their pieces on any point. (The center is off limits only for the first play.) When all six pieces
are on the board, players take turns moving the individual pieces, one at a time, along a line to the nearest
vacant Point. A piece can move in any direction; Diagonal moves are allowed, BUT THERE ARE NO
JUMPS.
The following is an example of an “ACHI” board where all the pieces have been played.
X | X |
-----------
O | X | O
-----------
| O |
You *can* win the game in the initial set-up phase, just like in a regular game of tic-tac-toe – three down,
three across, three diagonally. At this point in the game (if I am X), I can move my X to position 2 2 and
win!
How it works
This is a two-person game. So, your code should read a move from a “human” player, then call your lisp
functions to generate the computer’s move. A typical sequence might look like the following:
Welcome to the Achi game!
---------------
| | | |
---------------
| | | |
---------------
| | | |
---------------
Your move. Enter where you want to move? (0 2)
pf3

Partial preview of the text

Download ACHI Game Assignment: Implementing a MinMax Algorithm for a Two-Player Board Game - Prof. and more Assignments Computer Science in PDF only on Docsity!

Game Assignment

Due: November 4 Game You are to implement a system that is capable of playing the game 'achi' against another opponent. The hardest part of the whole assignment will be making it through these instructions, so get ready. Rules ACHI is a game very similar to tic-tac-toe. It is played on a 3 x3 board. Each player begins with 3 pieces (X's and O's for example). Players take turns placing their pieces on the board. Players decide who goes first. The first player puts a stone (or x) on any point on the board, except the center point. Players then take turns placing their pieces on any point. (The center is off limits only for the first play.) When all six pieces are on the board, players take turns moving the individual pieces, one at a time, along a line to the nearest vacant Point. A piece can move in any direction; Diagonal moves are allowed, BUT THERE ARE NO JUMPS. The following is an example of an “ACHI” board where all the pieces have been played. X | X |


O | X | O

| O | You can win the game in the initial set-up phase, just like in a regular game of tic-tac-toe – three down, three across, three diagonally. At this point in the game (if I am X), I can move my X to position 2 2 and win! How it works This is a two-person game. So, your code should read a move from a “human” player, then call your lisp functions to generate the computer’s move. A typical sequence might look like the following: Welcome to the Achi game!


| | | |

| | | |

| | | |

Your move. Enter where you want to move? (0 2)

| x | | |

| | | |

| | | |

I move next

| x | | |

| | o | |

| | | |

You move next ….. Etc… Requirements You will use the MinMax algorithm to decide what the best next move is. You will, therefore, need to have a "static board evaluation function." This can be as complex as you care to make it. And, of course, you will need a generate moves function (notice that due to the nature of the game, the generate moves function may be fairly complex). Hints

  1. The minimax will not be able to generate an entire game the first time. You will need to later your minimax to a particular depth and apply some type of evaluation function. Your evaluation function should take in a board with the new move. It should then return a board with a number representing goodness.
  2. We do not expect you to write a fancy graphics program for the interface. You should, however, be able to write a simple program that takes in a move and board from your partner and returns a board and new move. You can do this as a simple file transfer. Your function should then be loaded and be able to take your opponent's file.