Skip to content

MarioAderman/battleship

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

17 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿšข Battleship

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

๐ŸŽฎ Rules

This is a single-player mode where you play against the console. Here's how it works:

  1. 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
  2. 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.
  3. Win the Game:

    • The game ends when either you or the console sinks the other's entire fleet.

๐Ÿ› ๏ธ How to Play

  1. Clone the Repository:
    git clone https://github.com/your-username/battleship.git
    cd Battleship
  2. Run the Game: In your terminal, run:
    python main.py
    or
    python3 main.py
  3. Follow the Prompts:
    • The game will guide you through placing your ships and taking turns to strike the console's fleet.

๐Ÿ™ Acknowledgments

A big shoutout to DeepSeek for helping improve the code'ssynta and structure!


Enjoy the game, and may the best captain win! โš“

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages