COSC 231   FALL 2011   Project #3: Slime Trail

Distributed: 11/8/2011     Due: 11/21/2011

Short Description

Implement the 2 player board game Slime trail using Javascript, HTML and CSS.

Game play

This is a turn-based game. There are two players: human (Green) and computer (Red). The game board is a grid. Allow the human to choose between a 3X3 grid and a 5X5 grid (other sizes are permitted).

The Green goal is marked with color green and is located in the upper left corner; the Red goal is marked with color red and is located in the lower right corner.

There is a single piece on the board. Players take turns moving that piece. A player moves to a new position by clicking on the new position. The former position is marked with color black (the slime). A position which has been slimed (marked black), cannot be revisited.

A legal move is to an empty square (including goals) which is a 4 neighbor (N, S, E, W) of the current position. When a player moves to a goal, the game is over and goal's owner is the winner (it does not matter which player made the move). If there is no legal move for the current player, the game is over and is a draw.

To start, use the "pie rule". The computer generates a random position on the grid and places the piece on it. If the human wants that start position, he clicks on that position. That means the next move is the computer's turn. If the human does not want that start position, it is his turn to pick a next position.

User interface

Controls for this game:

Just how smart is the computer?

This is programmer's choice. The only constraint is that the computer must make only legal moves.

Here are some possible ways for the computer to make a decision:

Unspecified

All other facets are not specified. You will make appropriate design decisions.

Grade based on