Skip to content

[US-03] Track ship damage, announce sunk, and end the game

As a player I want the system to track damage per ship and end the game when a fleet is destroyed So that outcomes are clear.

The system shall:

  1. Track hits per ship and determine when all squares of a ship are hit.
  2. Upon completion, announce the ship as 'sunk'.
  3. When all ships of a player are sunk, declare victory for the opponent and disable further input.
  4. Provide New Game to start a fresh match.

Acceptance criteria (verifiable):

  • Given the last undamaged square of a ship is hit, when the result is processed, then that ship is announced 'sunk'.
  • Given the final enemy ship is sunk, when the board updates, then the match ends, the winner is indicated, and no further shots are allowed.
  • Given a finished match, when New Game is chosen, then both boards reset to covered, unplaced state.