haive.games.battleship.utils¶
Battleship game utility functions.
- This module provides helper functions for the Battleship game, including:
Board visualization
Coordinate formatting
Game status checking
Functions¶
|
Calculate game statistics from move history. |
|
Check if all required ships have been placed. |
|
Format a list of coordinates for display. |
|
Format a list of ship types for display. |
|
Create a string representation of the Battleship board. |
Module Contents¶
- haive.games.battleship.utils.calculate_game_stats(move_history)[source]¶
Calculate game statistics from move history.
- haive.games.battleship.utils.check_all_ships_placed(ship_placements)[source]¶
Check if all required ships have been placed.
- haive.games.battleship.utils.format_coordinates_list(coords_list)[source]¶
Format a list of coordinates for display.
- haive.games.battleship.utils.format_ship_types(ship_types)[source]¶
Format a list of ship types for display.