# CSCI 151 Project 1: Java and Arrays

## Overview

In this project, you will create a useful program with Java. Subject to a few requirements, you can do whatever you like, although there are a few suggestions below if you have trouble coming up with something on your own.

## Description

Write a Java application. Your program can do anything you like, subject to the following requirements:
• You must use Eclipse and Java, with input and output in a Main class.
• You must use an array, ExtensibleArray, or ArrayList somewhere in your program.
• Your program should use at least one class besides Main.
• The program should do something useful, interesting, or fun. It need not be complex, but it should be something that someone would conceivably want to use.
Feel free to use the Java API documentation (or documentation for the Java collections framework) as a reference for any piece of Java you might need; you are not restricted to only things we have covered in class.

## Suggestions

Here are a few suggestions to get you thinking, if you need them. Even if you choose one of these suggestions, you do not have to do it exactly as described (in fact, you probably shouldn't!).

Nim. Write a program to play the game of Nim (either human vs. human, or human vs. computer). This classic game starts with some number of piles of (counters, coins, beans, whatever). On your turn you must choose one of the remaining piles, and take anywhere from one counter up to all the counters in that pile. However, you may only take counters from a single pile on each turn. The winner is whoever takes the very last counter. Here is what part of an imaginary run of your program might look like:

A ***     (3)
B ******* (7)
C *       (1)
D         (0)
E ****    (4)

You can't take that many counters from pile A!  Try again.

A ***     (3)
B ******* (7)
C *       (1)
D         (0)
E *       (1)


Water Jugs. Reimplement the Water Jug game from CSCI 150 in Java, with an arbitrary number of jugs.

Tic-Tac-Toe or Connect 4. Implement a classic grid-based two-player game such as Tic-Tac-Toe (perhaps on $$n \times n$$ boards instead of only $$3 \times 3$$ ) or Connect 4.

Game of Life or other cellular automaton. Implement the classic Game of Life, or some other cellular automaton.

As a reminder:
• You may consult online resources (Java tutorials, StackOverflow questions, ...), and you may even use snippets of code you find there, but you must clearly cite them in your project, by adding a comment with the URL of the resource you used along with a short explanation of how you used it.
• You may discuss your project with other students in the class, but you may not look at another student's code, or share your code with another student. If you need help debugging your code, see an instructor or a TA.

## What to Hand In

Submit a zip file containing
• your whole project, along with
• an evaluation document detailing the intent of your application, any unique and interesting features in your application, and any joys or struggles you encountered in creating your application.