Program 1: Common Lisp

Solution

Due Date

This assignment is due at the beginning of the lecture on Friday, September 21st.

Partners

Everyone should complete this assignment with one partner. Submit one solution with both of your names on it.

Purpose

The purpose of this assignment is to give you practice solving problems in Common Lisp.

Gomoku

Read the rules for Gomoku. Gomoku will also be the basis for the Program 4 game playing tournament.

Assignment

Write a Common Lisp function named five-in-row-p (and any other auxiliary functions that are needed) in a file named go.l. The function should return t (true) if the last stone played results in a win and nil (false) otherwise.

The function five-in-row-p should make no assumptions about the size of the board that it is being passed. For example, the board might be the standard 19 by 19, but it might also be 10 by 12. However, the function may assume that the coordinates of the last move played are valid ones.

Starting Code

Take a look at the file tester.l. If the five-in-row-p function is coded correctly, the following output should be produced when (test) is typed into the Common Lisp command prompt:

Win for WHITE playing at (0, 3)
Win for WHITE playing at (0, 6)

What to Submit

The following materials must be received on or before Friday, September 21st at noon.

  1. A printout (not an e-mail) of the go.l file that contains the five-in-row-p function.
  2. An e-mail of the go.l file to John at paxton@cs.montana.edu

Grading

Valid XHTML 1.0!