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.
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.
To play the game, follow these simple steps:
Clone the repository to your local machine using the following command:
git clone https://github.com/pirozheka/battleship-game.git
Navigate to the cloned directory, and run the app.py
file:
cd sea_battle
python app.py
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:
- Enter the row number (a digit) and press Enter.
- 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.
- 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.
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!