Programming Assignment 1: Maze Game

Repository location:
SSH: git://

This programming assignment (PA1) is due next Monday 6/6.

Learning Objectives:

This assignment is designed to give you the opportunity to learn the following skills and concepts:
  • the use of Java packages to structure a code base with many developers
  • the use of Interfaces and Factory methods to allow multiple implementations of one concept by multiple developers
  • techniques for creating computer opponents of varying complexity to compete against humans
  • the use of a shared GIT repository

The idea here is to expand on the pre-work and to use it to start to create a simple maze-based game. The game takes place on a maze (that is generated randomly each time). The players move around the maze, one step at a time, taking turns. They may not move onto a space occupied by another player. The maze also contains jewels that players can collect by moving onto a space containing a jewel.  This act increases the players score by 1 and causes another jewel to appear at a random place in the maze. The game lasts for some fixed number of moves (say 1000) and the player with the most points wins.

Your task in this homework will be to create two new player classes. Each player object will have a nextMove method that will be given
  • a maze object (implementing the MazeBoard interface)
  • a position (implementing the MazePosition interface)
  • an ArrayList of MazePositions of the competitors
  • an ArrayList of MazePositions of the jewels
and will return the next move (N,S,E,W,P) for North, South, East, West,
and Pass.

The first class you implement should be a "dumb opponent" which makes its next move based on very little data (but not random!)

The second class should be more complex (trying to beat all the other opponents).

Submitting your work:
We will create a github project for PA1
and you should clone the project, add your packages, and push your changes.

The Tournament:
We will run a tournament (and in fact, you can run the tournament whenever you want) which will determine the best player. The idea will be to iterate through all pairs of players and to let them play for N steps on a KxK size board to see who is the winner. We will let each pair play J games with every other player.  The player that wins the most games is the tournament winner.
We will let your simple player and your complex player join in the tournament and your simple player might out perform the complex one (look up "tit-for-tat" in the Prisoner's dilemma competitions).