This is my version of the classic game Battleships on 7x7 playing field. It was a project from the resource Head First Java by Kathy Sierra and Bert Bates. the game is easy to play. It’s you against the computer, but unlike the real Battleship game, in this one you don’t place any ships of your own. Instead, your job is to sink the computer’s ships in the fewest number of guesses. Oh, and we aren’t sinking ships. We’re killing Dot Coms.
Sink all of the computer’s Dot Coms in the fewest number of guesses. You’re given a rating or level, based on how well you perform.Setup: When the game program is launched, the computer places three Dot Coms on a virtual 7 x 7 grid. When that’s complete, the game asks for your first guess.
This version works at the command-line. The computer will prompt you to enter a guess (a cell), that you’ll type at the command-line as “A3”, “C5”, etc.). In response to your guess, you’ll see a result at the commandline, either “Hit”, “Miss”, or “You sunk Pets.com” (or whatever the lucky Dot Com of the day is). When you’ve sent all three Dot Coms to that big 404 in the sky, the game ends by printing out your rating.
- Navigate to the repository on GitHub.
- Click on the "Code" button.
- Copy the URL for the repository.
- Open up a terminal window.
- Navigate to the directory where you want to store the repository.
- Run the command
git clone https://github.com/Dave-Vermeulen/Battleships
This will clone the repository onto your local machine. - Compiling the Files:
- Navigate to the directory where the repository is stored.
- Ensure that you have all the necessary dependencies installed on your machine.
- Run the
javac
command to compile each of the files respectively.
- Once the files have been successfully compiled, you can run them by executing the following command
java Game
. - Provide any required input to the program.
- Wait for the program to complete its execution.
Should you wish to contribute to this repo you can open a new issue.
This project is licensed under the Eclipse Public License - v 2.0 - see the /LICENSE file for details.