99EnriqueD / Battleship-Cpp-OOP

Battleship game written in C++ using object-oriented programming. To be played in the terminal.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

C++ Battleship Game by Enrique Dehaerne

This project was created by Enrique Dehaerne to practice programming in C++. It is a battleship game that runs in the command line of both Windows and Unix systems. This project is object oriented and incorporates polymorphism and an enumeration. The declaration of the classes can be found in the '.hpp' files.

The game has three phases. The first phase simply initialises the game. Parameters such as the board size and the ships used can be altered in the main (be sure to recompile after changing them). The second phase prompts the players to place ships on their boards. The third phase is where the players take turns attacking eachothers board. During their turn, they will see the enemy's board (without their ships shown) and their own board underneath. A '#' and a '@' represent a recent hit and miss respectively. A 'X' and a 'O' represent a hit and miss from more than a turn ago. When all ships of a player are sunk, the other player wins thus concluding the game.

Ascii art used in this project was generated on this website.

Enjoy!

About

Battleship game written in C++ using object-oriented programming. To be played in the terminal.


Languages

Language:C++ 100.0%