Skip to content

[US-04] Playing alone against the computer

Ivan Esau requested to merge feature/issue-4-us-04-playing-alone-against-th into master

Description

Implementation of single-player mode with computer AI opponent.

Changes

  • Added ComputerPlayer class with AI logic for ship placement and shooting
  • Implemented single-player game mode with computer opponent
  • Added difficulty levels (Easy/Random and Normal/Strategic)
  • Integrated computer AI with existing game state management
  • Added comprehensive test coverage for computer AI behavior

Requirements Implemented

Single-player mode where computer places ships correctly (no overlaps, within boundaries) Computer takes turns shooting at valid coordinates not previously used Different difficulty levels: Easy (random) and Normal (strategic targeting) Computer fleet is valid and hidden at game start

Acceptance Criteria Validation

When single-player mode starts, the computer's fleet exists, is valid and hidden When the computer makes a move, its shot is at a coordinate not previously targeted In Normal mode, if a shot hits, following shots should usually try neighboring cells until that ship is sunk

Current Status

Pipeline Status: SUCCESS - All 107 tests passing (0 failures, 0 errors, 1 skipped)

  • Computer AI logic fully implemented and tested
  • Game state transitions working correctly
  • Shot validation and recording functioning properly
  • Strategic targeting in Normal mode operational

Ready for merge - all validation criteria met.

Closes #4 (closed)

Edited by Ivan Esau

Merge request reports

Loading