This project is REQUIRED/MANDATORY/COMPULSORY. You cannot drop your project score and you cannot use any late days on this project.
Important Note: Late days applied only to homework assignments; you may not submit the Project late. No exceptions.
This is a closed-ended project that provides you the opportunity to apply everything you have learned in 110 to one of the options below. You will be responsible for choosing one of the four given problems, analyzing that problem to determine how to solve it, decomposing the functionality of your program to identify its class structure and the API for each class, and then implementing and testing your program.
You are not permitted to work with a partner on this project.
Start early and reach out to the Instructors/TAs if you have any questions or concerns.
You may be tempted to use code directly from the internet or use such code as a base template. Please do not do so. We are extremely adept at catching such cases and strict action will be taken.
CIS 110 is an Introduction to programming in Java course. Java is by definition an object-oriented programming class. The purpose of this project is for you to demonstrate everything you have learnt in this class - with an emphasis on object-oriented programming. All of the project idea choices that you have are games that require object-oriented structure. When approaching this assignment, it will be very useful to refer back to the Snake and Tetris games that you created with Dr. Eaton in class.
In this project, you will implement a Battleship game.
Battleship is a board game involving a grid. Players begin by placing their ships onto a square 10x10 grid. Once the placement is over, players take turns guessing the opponent's grid squares onto which to fire. By hitting all of the grids of an opponent's ship, you will sink her ship. Guesses are of the form A-0 or J-9.
You must have one of each of the following five types of ships -
Your battleship game must be one player so it will involve a simple cpu player. The simplest approach is to make the A.I. randomize so that it guesses randomly at grid squares and places its ships randomply as well. Feel free to make the A.I. more complex if you want.
Requirements -
Connect 4 is a classic board game where two players (typically "red" and "yellow" or "red" and "black") take turns dropping disks in a grid of 7 columns by 6 rows. The discs fall to the lowest empty space in their column (possibly landing on top of other pieces). The winner of the game is the first to have 4 discs of their color in a row. This can be horizontally, vertically, or diagonally.
If you are unfamiliar with the game, this video should help out. It talks about how Connect Four is a solved game, and if you played against a correctly programmed computer who goes first, you will always lose.
In this program, you must program a Connect 4 game that uses mouse clicks as input that has both a 2-player mode and a 1-player mode. When your program starts, the game should have some start screen where the player can select either 2-player mode or 1-player mode using mouse clicks.
Players will interact in the game using mouse clicks. If a player clicks in a column, it should drop a piece into that column if possible. However, if the column is already full, the player cannot drop a piece in that column, nothing should happen (your program must not crash here). Once a player has successfully played a piece, their turn is over. The game should check if the move created four-in-a-row of the same color. If it has, the game is over, and your game should print the winner. If not, it should simply pass the turn to the other player.
If all 42 spaces in the grid are filled, the game is a draw, and no one wins. Below is an example of a draw.
In the 2 player mode, players will use mouseclicks to select which column they wish to drop their piece in and end that players turn. The game should then prompt that it is the others player turn. The game should clearly indicate which players turn it is using their disc color (for example, you could have text saying "It's reds turn"). The turns should go back and forth until the game ends.
In 1 player mode, the player can play against an automatic opponent that you program. This does not have to be a "good" AI, just some process by which moves are taken automatically without player input. The game should randomly decide to have either the human or the computer go first (since moving first is a big advantage). From there, the game proceeds until it ends.
In either case, when the game ends, the game should show some text indicating either who won or that the game was a draw. The game must then return to the "start" screen, where a player can once again choose either 1-player mode or 2-player mode.
Do not spend a lot of time working on the AI until after your program is working. You will not get extra credit if your AI can beat the instructor, though it can be fun to try. Focus on getting the game working first with 2 players.
Look back to HW01's StampSketch.java if you need a refresher on how to get the location of a mouse click.
Consider what objects you can use, as well as what functions you can use, to represent the board.
For this option you will be implementing the highly addictive (at least for me) 2048 game. Here is a link to a description of the game.
The best way to understand the game is to play it yourself. You can easily download it on your phone's appstore or google for a playing version online.
Requirements -
Hangman is a vocabulary game. A link to the game is here.
Requirements -
When you are ready to submit, put all the code and files for your project in a folder and zip it. The zip file should be named according to the name of your project - battleship.zip
, 2048.zip
, connect4.zip
, hangman.zip
. Submit this file and the project readme through the dashboard.
Congratulations on finishing the last assignment of CIS 110. From Dr. Eaton and all the TAs, we hope you enjoyed the class.
This project was writted by Rohan Bhide. The game ideas do not belong to us.