Awari Moves

PSU CS 410/510 Games Homework 4
Due before class Tuesday August 1
Not accepted after Tuesday August 8

The remainder of this course will concentrate on the game of Awari. In this assignment, I will ask you to write an Awari move generator and referee: a program that, given a state, emits

  1. A set of legal moves in the state
  2. For each move

States will be represented on input and output in the following format (one datum per line):

  1. Side to move: "n" or "s"
  2. Score: integer north score and south score separated by whitespace
  3. A sequence of 6 integers separated by whitespace indicating the contents of pits f, e, c, d, b, and a
  4. A sequence of 6 integers separated by whitespace indicating the contents of pits A, B, C, D, E, and F
The program should be able to read such a state on standard input or from a file, and output to standard output or a file a bunch of records consisting of a line indicating which move was made (by letter) followed by a line indicating whether the resulting state is final ("final" or "next") and then by the state itself.

The rules variant to be used is the Mind Sports Olympiad one. Make sure to test your code against the various special cases of the rules. Also make sure to keep the actual move generator and referee modular, so that you can reuse them in your larger Awari program.


Homework should be submitted by e-mail to <cs510games@cs.pdx.edu>. The words "cs510games hw4" should appear somewhere in the subject line. The homework submission should be a MIME message containing your source code, a writeup in ASCII answering all questions posed by the assignment, and the results of program runs. Please follow all accepted coding and software engineering practices for your programming language. Remember, if I can't understand your submission, I can't give you credit for it.

I'd like you to do this assignment by yourself. If you do work with anyone else, you must credit them in your submission.