https://github.com/max21910/bataille-navale
A Bataille-Navale Game made in c++ for a school project
https://github.com/max21910/bataille-navale
cpp france game shoolproject
Last synced: 7 months ago
JSON representation
A Bataille-Navale Game made in c++ for a school project
- Host: GitHub
- URL: https://github.com/max21910/bataille-navale
- Owner: max21910
- Created: 2024-01-02T13:39:24.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-17T23:31:38.000Z (over 1 year ago)
- Last Synced: 2025-01-27T06:22:40.482Z (9 months ago)
- Topics: cpp, france, game, shoolproject
- Language: C++
- Homepage:
- Size: 105 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Bataille Navale Game in C++
This is a console-based Bataille Navale (Battleship) game implemented in C++.
(this is a school project)
Overview
This program simulates a two-player Battleship game where players place their ships on an 8x8 grid and take turns to guess and attack each other's ships.![]()
![]()
## Gameplay
-Players input the positions of their ships by specifying the column (A-H) and row (1-8).-Once ships are placed, players take turns to fire at the opponent's grid by inputting coordinates.
The game ends when one player successfully sinks all of the opponent's ships.
## How to Play
Compile the code using a C++ compiler.
Run the compiled executable.
Follow the instructions to input ship positions and take shots at the opponent's grid.
Code Structure
printNavireA() and printNavireB() print the initial ship placements for Player A and Player B, respectively.
printshootA() and printshootB() display the shots fired by Player A and Player B.
input_playerA() and input_playerB() allow players to input their ship positions.
Place_Fire() controls the turn-based firing mechanism and determines the winner.
createGameTable() initializes the game grids.
Usage
To run the game:# Compile the code
```
g++ Bataille-Navale.cpp -o BatailleNavale
```
# Run the compiled code
```
./BatailleNavale
```
Follow the on-screen instructions to play the game.created with ❤️ by max21910 in 🇫🇷