Skip to content

This project involves creating a C++ object-oriented model for a single-player version of Battleship, encompassing elements like ship arrangement, game state display, and shooting mechanics.

Notifications You must be signed in to change notification settings

swaroop929/BattleShip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Battleship Game in C++

Introduction

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.

Game Description

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.

Object-Oriented Programming (OOP) Concepts

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.

How to Play

  1. Clone the repository to your local machine.
  2. Compile the C++ files using your preferred compiler.
  3. Run the executable to start the game.
  4. Follow the on-screen instructions to arrange your fleet and start playing against the computer.

Feedback and Improvements

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!

Acknowledgments

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

About

This project involves creating a C++ object-oriented model for a single-player version of Battleship, encompassing elements like ship arrangement, game state display, and shooting mechanics.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published