How messengergp/battleshipsproject works
This is a single-file, console Battleship game. A player chooses a new game, loads a saved game, or replays a completed game; setup places ships, turns accept coordinates and resolve shots, and a win records the finished state. Between turns, the game menu supports saving, loading, restarting, and exiting. The excerpt confirms the main game, combat, board, and finished-game persistence behavior; some menu and save/load wiring is inferred only where the excerpt shows the corresponding options or calls.
Main entry points: main.c Turn handling · Finished_Game.sav Completed save · Saved_Game.sav In-progress save
Components 13
Console interface
- Start and replay menu
main.c - Between-turn menu
main.c - Board display
main.c
Game runtime
- Game loop
main.c - Game setup
main.c - Ship placement
main.c - Turn handling
main.c - Shot resolution
main.c - Game state
main.c
Saved state
- In-progress save
Saved_Game.sav - Completed save
Finished_Game.sav - Save and load
main.c
Other components
- Player
Connections 17
- Player → Start and replay menu: chooses
- Start and replay menu → Game loop: starts or loads
- Game loop → Game setup: initializes
- Game setup → Ship placement: places ships
- Game loop → Turn handling: runs turns
- Turn handling → Shot resolution: resolves shot
- Turn handling → Board display: displays board
- Player → Turn handling: fires at
- Game loop → Between-turn menu: offers options
- Between-turn menu → Save and load: requests save or load
- Save and load → In-progress save: reads or writes
- Turn handling → Save and load: saves on win
- Save and load → Completed save: reads or writes
- Game loop → Game state: updates
- Game setup → Game state: initializes
- Turn handling → Game state: updates
- Start and replay menu → Completed save: replays completed game