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. #102

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.

Problem Summary

The issue requires expanding the allowable size for a Battleship board from a range of 6-15 cells to 6-25 cells. This change will involve updating the logic that validates board size inputs and possibly other related functionalities that depend on board dimensions.

Relevant Files

Guidance for Code Changes

BattleshipSalvo.java

AbstractPlayer.java

ViewImpl.java

Summary

To implement the change, update the board size validation in BattleshipSalvo.java to allow sizes up to 25. Ensure that all user-facing messages and logic that depend on board dimensions in ViewImpl.java are consistent with this new range. Check AbstractPlayer.java to confirm that ship setup logic remains compatible with larger board sizes. This approach ensures the game can handle larger boards while maintaining current gameplay mechanics.