Assignment 2

Game Playing Problems

Max possible score:

Task 1

NOTE: For CSE 4308 Students (CS) this Task will be used as part of their ABET Assesment.

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 or two marbles from it (if possible). 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>
For a full game,
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.

ABET Assesment (For CSE 4308 Students):

For CSE 4308 Students (CS) their submissions for this assignemnt will be evaluated according to the rubric provided in the back of the syllabus. They do not need to do any additional work for this. Also the highest scoring, median scoring and lowest (non zero) scoring submissions will be anonymized and submitted to the Assement committee.


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: