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.

Materials

Description

Write a Java application. Your program can do anything you like, subject to the following requirements: 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)

Your move? A5
You can't take that many counters from pile A!  Try again.
Your move? E3

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.

Academic Integrity

As a reminder:

What to Hand In

Submit a zip file containing

Grading

Any project that meets the first three requirements will receive at least a B.

To earn an A, the project must, in the instructor's judgement, exhibit some creativity and have some interesting features; I am happy to give feedback along the way.


original © Mark Goadrich, Hendrix College
revised and extended by Brent Yorgey, Hendrix College