Skip to content

pirozheka/sea_battle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Battleship Game in Python

Dive into the classic game of Battleship. Engage in a naval strategy board game against the computer and test your mettle as you try to sink all enemy ships before they decimate your fleet.

Prerequisites

Before you begin, ensure you have the following libraries installed:

  • random
  • time

Both libraries are part of the Python Standard Library, so you shouldn't need to install anything extra.

Getting Started

To play the game, follow these simple steps:

Step 1: Clone the Repository

Clone the repository to your local machine using the following command:

git clone https://github.com/pirozheka/battleship-game.git

Step 2: Run the Game

Navigate to the cloned directory, and run the app.py file:

cd sea_battle
python app.py

How to Play

Once you have started the game, you'll be prompted to input your moves in the console. The format for making a move is as follows:

  1. Enter the row number (a digit) and press Enter.
  2. Enter the column number (a digit) and press Enter.

For example:

3 [Enter]
5 [Enter]

This would target the cell at row 3, column 5.

Important Notes

  • On occasion, the board may not generate correctly. If this happens, simply restart the game a few times until the boards are generated properly.
  • The game is played entirely in the console. No graphical interface is provided.

Feedback

If you encounter any issues or have suggestions for improvements, please open an issue in the repository.


Enjoy testing your strategic skills with this simple yet engaging Python implementation of Battleship!

About

Sea Battle Game in Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages