giovabattelli / terminal-battleship

Play a game of battleship (with modified game rules) against a basic AI in the terminal.
0 stars 0 forks source link

Add support for a battleship board of size 25 cells; instead of board size being between 6-15, it can be between 6-25 cells. #100

Open giovabattelli opened 3 weeks ago

trysherpa[bot] commented 3 weeks ago

Please note, Sherpa may occasionally provide incomplete or inaccurate information. Always verify critical details and double-check suggested changes before implementation.

Summary of the Problem

The issue requires modifying the existing battleship game to support a board size of 25 cells instead of the current limit of 15 cells. This change involves updating the logic that handles board dimensions and ensuring that all related functionalities accommodate the new size range.

Relevant Files

Changes Required for Each File

1. BattleshipSalvo.java

2. AbstractPlayer.java

3. Board.java

4. ShipType.java

Summary of the Approach

To implement the support for a battleship board of size 25 cells, you will primarily focus on modifying the BattleshipSalvo class to accept new height and width limits. Ensure that the AbstractPlayer, Board, and ShipType classes are reviewed for any dependencies on the old size constraints. After making these changes, thoroughly test the game to verify that all functionalities work correctly with the new board size.