COSC 159 - Artificial Intelligence Assignment #2 Let's Play a Game Due: Monday, February 23 GOAL: Write a Lisp program which plays the game of Arithmetical Croquet (rules can be found on studsys in the file ~mikes/159/croquet.txt). That is, your program should be able to play against a human. Your program should be able to be either the first or second player. The program should play by searching the game tree to find a good move, not just be hard-coded for specific moves. METHOD: You should implement a basic minimax tree search (see p.160 of the textbook). However, rather than searching the full tree for each move, the functions should be designed to only look a limited number of levels down in the game tree (probably about 3 or 4). One easy way to design this is to write a function (say (evalmax state depth)) which takes a game state description and an integer depth and returns a numeric value for that board position assuming that it's the computer's move next based on looking ahead depth moves. Similarly, (evalmin state depth) would return a numeric value assuming it's the opponent's move. In keeping with the minimax approach, evalmax would produce an answer by calling evalmin on each of the next boards (with a depth one smaller) and choosing the maximum of those. evalmin would call evalmax on each new board and choose the minimum. In each case, if depth was equal to zero, a separate static evaluation function would be called to estimate the value of the board position. As a practical matter, you may find it a bit tedious to play out a whole game (to 100) every time you want to test your program. While the final (submitted) version of your code should play to 100, you could consider changing the goal to 40 or 50 during program development. SUPPORT: There are some functions in the file ~mikes/159/croquet.lisp on studsys which may be helpful in attacking this program. In particular, the function AC-next correctly computes the legal moves from a given state. You are encouraged to use this function in your game player. TOURNAMENT: We'll be having a tournament in class between the various programs sometime shortly after the due date. In order to make that work, I'll need to describe a standard input and output for your program and also specify some sort of time limit for each move. For right now, don't worry about those details. I'll let you know as soon as I figure out how the tournament will work. HAND-IN: You email me the Lisp code for your game playing program along with a sample run showing how the program is used.