Welcome to Battleship, a Python project designed to review and practice fundamental programming concepts by simulating the classic game of Battleship! This project covers:
- Conditional Statements
- Loops
- Object-Oriented Programming (OOP)
- File Handling (Txt Files)
- Libraries (
random
,os
,shutil
) - Functions
This is a single-player mode where you play against the console. Here's how it works:
-
Place Your Fleet:
- You can place a boat, a submarine, and a destroyer on a 10x10 grid by specifying the coordinates.
- Each ship has a specific size:
- Boat: 2 cells
- Submarine: 3 cells
- Destroyer: 4 cells
-
Strike the Enemy:
- Once your fleet is placed, you can choose coordinates to strike the console's fleet.
- The console will also take turns to strike your fleet.
-
Win the Game:
- The game ends when either you or the console sinks the other's entire fleet.
- Clone the Repository:
git clone https://github.com/your-username/battleship.git cd Battleship
- Run the Game:
In your terminal, run:
or
python main.py
python3 main.py
- Follow the Prompts:
- The game will guide you through placing your ships and taking turns to strike the console's fleet.
A big shoutout to DeepSeek for helping improve the code'ssynta and structure!
Enjoy the game, and may the best captain win! ⚓