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.
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:
- Python
- Enter 'yes' or 'y' to start a new game
- Any input besides those two and 'no' or 'n' will be ignored
- You will be prompted to choose a number from 5 to 15, which sets the game board size and number of guesses to that number
- You will be prompted to choose a row number and then to choose a column number
- If either guess is less than 5 or more than the previously provided maximum, you will be prompted to choose a valid selection
- If you enter a row or column that you already guessed, you will be told such and you will have used a turn
- The game continues until you either make a correct guess or run out of guesses
- You will then be asked if you want to start a new game