Assignment 2

Game Playing Problem

Max possible score:

Task 1

Max: [4308: 100 Points, 5360: 100 Points]

Your task is to build an agent to play two versions (standard and misère) of  the variant of a game called nim (called red-blue nim against a human player). The game consists of two piles of marbles (red and blue). On each players turn they pick a pile and remove one marble from it. If on their turn, either pile is empty then they lose in the standard version and win in the misère version. The amount they lose (or win) is dependent on the number of marbles left (2 for every red marble and 3 for every blue marble). So if on the computer player turn, it has 0 red marbles and 3 blue marbles, it loses 9 points in the standard version (or wins 9 points in the misère version).

Your program should be called red_blue_nim and the command line invocation should follow the following format:

red_blue_nim.py <num-red> <num-blue> <version> <first-player> <depth>
On Computer turn, the program should use MinMax with Alpha Beta Pruning to determine the best move to make and perform the move.
On Human turn, the program should use a prompt to get the move from the human user and perform the move.
The program should alternate between these turns till the game ends (when the players run out of either red or blue marbles). Once the game ends, calculate who won and their final score and display it to the user.

Extra Credit (20 Points):

If your program determines computer move by using depth limited MinMax search with alpha beta pruning then you will be given 20 points extra credit. You will need to come up with a eval function to use with the program also. Please submit a text file describing the reasoning behind your eval function for full credit.


How to submit

Implementations in C, C++, Java, and Python will be accepted. Points will be taken off for failure to comply with this requirement unless previously cleared with the Instructor.

Create a ZIPPED directory called <net-id>_assmt2.zip (no other forms of compression accepted, contact the instructor or TA if you do not know how to produce .zip files).
The directory should contain the source code for the task (no need for any compiled binaries). Each folder should also contain a file called readme.txt, which should specify precisely: