A C++ implementation of the game Battleship, which can be played by 2 players over LAN on the terminal. Networking is done using the C++ Boost Asio library, and the game is implemented using OOP.
Symbol | Meaning |
---|---|
O | Ship |
H | Hit |
X | Miss |
. | Empty |
- Grid Size is fixed to 10x10
- Each player has 2 boards
- target: grid that shows where player has shot, along with hits and misses)
- shipyard: grid which contains the player's ships, along with opponent's hits and misses
- Grid Cells are number from AA to II (row, column)
- Player 1 - server
- Player 2 - client
- By default, Player 2 will try to connect to a server created on the same machine (localhost)
- To play across machines, make this change in client.cpp: "127.0.0.1" -> IPAddress of Player 1's machine
- Use make to link header files, compile and create executables
- Start server before running client
- C++ 11
- Boost.Asio - for networking
- save/load support
- 1P version v/s AI (Reinforcement learning agent)