Welcome to the C++ implementation of the classic Battleship game! This single-player version brings the timeless naval strategy game to life on your computer. It's a fun and engaging way to test your strategic thinking skills.
In this version of Battleship, players will set up their fleet of ships on a grid, then take turns firing shots to sink the opponent's ships. This project is designed as a single-player game against a computer-controlled opponent. It features a console-based user interface for ship arrangement and tracking shots, providing an intuitive and interactive gaming experience.
This game is developed using robust OOP principles in C++, ensuring a well-structured and maintainable codebase. Key OOP concepts utilized include:
- Encapsulation: Classes encapsulate the data and functions related to game elements, like ships and the game board.
- Inheritance: Utilizing inheritance to create a hierarchy of classes, allowing for reusable code and an organized structure.
- Polymorphism: Through polymorphic functions, the game can handle different game states and interactions dynamically.
- Abstraction: Abstracting complex operations behind simple interfaces, making the game easy to play and understand.
- Clone the repository to your local machine.
- Compile the C++ files using your preferred compiler.
- Run the executable to start the game.
- Follow the on-screen instructions to arrange your fleet and start playing against the computer.
Your feedback is invaluable in making this game better. If you have suggestions for improvements or want to report any issues, please feel free to connect with me on LinkedIn at https://www.linkedin.com/in/swaroop929/. All ideas and contributions are welcome!
- Thank you to everyone who has played and provided feedback on this project.
- Special thanks to Prof. Michael Lipp for their guidance and support.
Enjoy the game, and may the best fleet win!