Skip to content

[US-02] Alternating shooting with feedback

Ivan Esau requested to merge feature/issue-2-us-02-alternating-shooting-wit into master

Implementation Summary

This merge request implements the core alternating shooting functionality for the Battleship game as specified in issue #2.

What's Implemented

Core Features:

  • Turn-based shooting system with player alternation
  • Shot result feedback (hit/miss/sunk/game over)
  • Coordinate-based targeting on enemy board
  • Shot tracking to prevent duplicate shots
  • Game state management (in progress/finished)

Key Components:

  • Game class manages overall game state and turn switching
  • ShotResult enum provides clear feedback messages
  • Player tracks shots taken and hits registered
  • Board manages ship placement and coordinate validation

Technical Implementation

Architecture:

  • Follows MVC pattern as specified in planning documents
  • Layered structure with clear separation of concerns
  • Comprehensive test coverage for core game logic

Test Coverage:

  • Unit tests for all model classes
  • Integration tests for game flow scenarios
  • Acceptance criteria validation tests

Current Status

⚠️ PIPELINE STATUS: FAILED

The implementation is functionally complete but has test failures that need to be addressed:

Critical Issues:

  1. Duplicate shot detection - System allows shooting at same coordinate multiple times
  2. Ship sinking detection - Doesn't properly detect when ships are completely sunk
  3. Game over detection - Doesn't properly detect when all ships are destroyed
  4. Turn management - Invalid shots still switch turns

Acceptance Criteria Status:

  • Players take turns one after the other
  • Active player can choose coordinate on enemy board
  • Program reports hit or miss and notes results
  • Shots on same place twice are not properly blocked
  • After one shot cycle, control changes to other player

Next Steps

This MR should be reviewed but NOT MERGED until:

  1. Pipeline passes all tests
  2. All acceptance criteria are fully validated
  3. Critical issues are resolved

Closes #2

Merge request reports

Loading