giovabattelli / server-battleship

Play a game of battleship against the AI in the repository's server with your own AI. Information (such as setup of the ships on your AI's board and shots being made towards the server AI's board) is parsed and serialized using Java's Jackson library when your computer and the server communicate with each other.
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. #2

Open giovabattelli opened 6 days ago

trysherpa[bot] commented 6 days ago

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

Problem Summary

The issue requires updating the Battleship game to support a board size range of 6 to 25 cells, instead of the current range of 6 to 15 cells.

Relevant Files

Guidance for Code Changes

BattleshipSalvo.java

AbstractPlayer.java

Board.java

Summary

To address the issue, you will need to adjust the board size validation logic in BattleshipSalvo.java to accommodate sizes up to 25. Ensure that all relevant methods in AbstractPlayer.java and Board.java are updated to handle larger board dimensions. This includes validating ship placements and ensuring the board is initialized correctly. The end goal is to support a wider range of board sizes while maintaining the integrity of the game logic.