Live Version - https://pp3battleship-3dbac7446df0.herokuapp.com/
Battleship is a classic game traditionally played as a board game. This is a slightly manipulated version of the classic rules.
The player will see a blank grid or gameboard with the x and y axis labeled A-E and 1-5. The player will enter the coordinated they think an enemy ship is located and drop a bomb on that location. The user will have 15 attempts to take out 5 enemy battleships. If the user locates an enemy ship it will show up as "X" on the grid. If the user takes a shot and misses all enemy ships a "O" will be displayed on the grid.
If the user takes out 5 enemy ships in less than 15 attempts then they are victorious. If the user runs out of bombs before taking out 5 ships they will lose.
The goal of this project is to create an entertaining and challenging game with a decent amount of replayability and to display the creator's understanding of python essentials.
First Time Goals
On my first visit to the game I want to
- be entertained by the game
- see rules clearly displayed at the beginning
- beat the game
- be visually stimulated by the game
- be able to use the game without any errors
On my second visit I would like to defeat the game if I was unsuccessful the first time.
If I was a repeat user I would like to see new features added to keep me stimulated.
Hidden grid with ships on it and displayed empty grid for guessing
To test the input validation I deliberately entered invalid data. A successful result would be a prompt to the user to enter a valid option.
This was a success.
The project was tested in Heroku as can be seen in the features section.#
Also tested different difficulty levels successfully.
I used Pep8 online validator to test my python code.
After fixing these errors I recieved a success message.
As was required by this project I had to deploy my project to Heroku. I done this by following these steps:
- Commit and push final code to GitHub
- Open Heroku
- Open a new app in Heroku
- Select a name for the app and select region as Europe
- Add buildpacks to the app. Add Python and NodeJS in that order. Make sure Python is on top.
- Add config vars. Fill in PORT as the key and 8000 as the value.
- Go to Deploy tab
- Connect GitHub account and select repository
- Manually deploy the main branch
- Success
- My mentor Marcel Mulders
- Heroku
- GitHub
- GitPod
- Youtube. Specifically https://www.youtube.com/watch?v=tF1WRCrd_HQ
- Code Institute
- Used random python import to select random integers