Ben Pew - 0860635 Compsci 210 Thurday 7:00-8:20 Lab This program plays connect 5. It blocks opponents series of 4 and will make a streak of 5 if it is possible. For a very detailed look at what it does, look to http://www.owlnet.rice.edu/~comp210/Assignments/Connect5/connect5.html. To run the program, simply type ./connect5 < test-case or run the conn5-gui program. If you run conn5-gui then as one of the players enter dugfin as the user name. The board is still represented as 'X's and 'O's with '-'s for the blank spots. After it reads in the board, it then transforms it into a matrix that is a vector of vectors with length of the list + 2. The + 2 forms a boarder around the board in which I have inserted a neutral piece 'T. This spot is neither an X nor an O, but unlike a - it blocks a streak. This makes the compute-value function easier to write. In order to find a move, it rates all the current blank spaces. So first, there is a function that searches through the board and returns a list of all the blank spaces as positions. This list and the board are then dumped into another function called compute-values. This function then individually calls the function computer-value and forms a list of spaces out of it. A space has the high offensive value, the high defensive value and the total value for the move. Next, there is a function that determines if there is a for sure lose or win move with the high offensive value and the high offensive value. If there is, it returns that value. If not, then the list is sorted by the total value of the move. This is done for recurision to see which move really is the best, but that was never implimented :). So instead it just takes the move with the highest current value and returns it. The control function does the proccess outlined above, and then sends the resulting move to the function display-move which displays the move correctly. So thus, if the way the function is read in, or the way the move is displayed changes, only one function needs to be changed. The program plays decently (It can beat me every game, but I suck at tic-tac-toe, connect4 and apparenetly connect5). It blocks streaks of 4, wins the game if it can. If it sees a trap laid out it will use it to win, or try to block it if it is an opponents trap. It will build streaks. If it sees the computer has a forced win in 2 moves, and it has a forced win in 1, it will go for its forced win instead of blocking the computers. It really doesn't do anything too interesting, and at the same time, it really doesn't have any bugs. The only problem with it is that it doesn't see advanced and well thought out (or lucky) traps that the other computer might set up.