Skip to content

An engaging Battleship game on Java console with single-player and two-player modes, featuring computer opponents at different difficulty levels.

License

Notifications You must be signed in to change notification settings

xylium117/Battleship-v2

Repository files navigation

Battleship V2

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! ⚓️🎮

Java IntellIJ IDEA

GitHub License

Table of Contents 📜

Introduction

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.

Features

  • 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

How to Play

  1. Clone this repository to your local machine:
  git clone https://github.com/AyushmanSarkar/Battleship-v2.git
  1. Navigate to the project directory:
  cd Battleship-v2
  1. Compile the Java code:
  javac Main.java
  1. Run the program:
  java Main
  1. Follow the on-screen instructions to start the game, place your ships, and take your shots.

Computer Difficulty Levels 💻

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.

Contributing 🤝

Contributions are welcome! If you'd like to improve this game, fix a bug, or add a new feature, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your changes.
  3. Make your changes and commit them with clear, concise commit messages.
  4. Push your changes to your fork.
  5. Submit a pull request to the original repository.

License 📝

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! 🌟

About

An engaging Battleship game on Java console with single-player and two-player modes, featuring computer opponents at different difficulty levels.

Topics

Resources

License

Stars

Watchers

Forks

Languages