🚢
Py-Battleship


Battleship is a Python command line game.
The player can choose the size of the grid, from 5x5 up to 15x15, and the ship will be randomly placed in that grid. The size of the grid also determines the number of turns the user gets, from 5 to 15.
The game handles incorrect entries and can be replayed repeatedly.
Do you want to start a new game of Battleship? yes
Enter a number between 5 and 15.
This will determine how big the playing board is and how many turns you have to find the Battleship. (5 rows, 5 columns, 5 turns, etc.): 5
Welcome to Battleship.
A ship, one cell long, has been randomly placed on the below 5x5 grid.
You have 5 turns to find it.
O O O O O
O O O O O
O O O O O
O O O O O
O O O O O
Turn 1 of 5
Guess Row: 3
Guess Column: 2
Miss!
O O O O O
O O O O O
O O O O O
O O X O O
O O O O O
Turn 2 of 5
Guess Row: 1
Guess Column: 4
Congratulations! You sank my battleship!
Download main.py, change to the directory where you downloaded the file and run it using python3 main.py
Py-Battleship is built with the following tools and libraries: