Welcome to the Battleship game in Java! This classic naval warfare game allows you to play against a computer opponent in three different difficulty levels or challenge a friend in two-player mode. ⚔️
Drop your anchors and sail to victory! ⚓️🎮
Battleship is a strategy board game where you and your opponent take turns trying to sink each other's fleet of ships. This Java implementation allows you to enjoy the game in both single-player and two-player modes. Challenge yourself against a computer opponent with varying levels of difficulty, or play with a friend locally.
- Single-player mode against a computer opponent
- Two-player mode for local multiplayer
- Three difficulty levels for the computer opponent (Easy, Medium, Hard)
- Interactive command-line interface
- Beautifully designed game board with ASCII art
- Clone this repository to your local machine:
git clone https://github.com/AyushmanSarkar/Battleship-v2.git
- Navigate to the project directory:
cd Battleship-v2
- Compile the Java code:
javac Main.java
- Run the program:
java Main
- Follow the on-screen instructions to start the game, place your ships, and take your shots.
Choose your level of challenge when playing against the computer:
- Easy: The computer opponent makes random shots.
- Medium: The computer opponent uses basic strategy to target your ships.
- Hard: The computer opponent employs advanced tactics to maximize its chances of winning.
Contributions are welcome! If you'd like to improve this game, fix a bug, or add a new feature, please follow these steps:
- Fork the repository.
- Create a new branch for your changes.
- Make your changes and commit them with clear, concise commit messages.
- Push your changes to your fork.
- Submit a pull request to the original repository.
This project is licensed under the MIT License.
Have fun playing Battleship! 🚢
If you have any questions or feedback, feel free to open an issue in this repository. Enjoy the game! 🌟