Welcome to Battleships!
This is a simple guessing game where the computer generates a board with 5 ships and the player must sink them in 10 turns.
-
An empty board will be displayed and the player must input a row guess between 1 and 8.
-
The player will then input a column guess between A and H.
-
The empty board will display and show if its a HIT or MISS. HIT = X MISS = -
-
Repeat until either all ships are sunk or turns run out.
Target Audience
The target audience for this app are beginners to a battleships game and other users who want a casual gaming experience.
User Stories
-
As a user, I want a clear description as to how to play the game. End user goal: Understand rules of game. End business goal: Keep users playing game. Acceptance criteria: Place clear print messages telling player to input value, Add clear info of rules in README.
-
As a user, I want to be told if make a mistake. End user goal: Fix mistake to keep playing. End business goal: Keep users playing game. Acceptance criteria: Display error message when input is invalid, Return input.
-
As a user, I want to know how many turns I have left. End user goal: Know how many guesses are left. End business goal: Keep users playing game. Acceptance criteria: Display turns left when guess is a MISS.
Start of Game
Displays Board and Input Fields
If Missed A Shot
Displays MISS and returns how many turns are left to guess
Guessed Already
Displays Error if user guessed in that space already
Game Over
Displays Game Over showing the board that the computer generated
After creating the board and the function for the user to guess. I constantly played through the game ensuring that all error messages were working with each further addition and change.
One major addition that I almost overlooked was the try and except function that stops empty inputs being valid or crashing the game.
Using Pep8, I pasted the finished code that yeilded minor warnings that some I was able to fix and one error that I was not but the app still runs smoothly.
ExtendsClass showed no errors.
-
Add ability for user to create board and place ships and computer to guess.
-
Increase size of battleships so vary in sizes and allow for computer to use tactics to sink player ships.
GitHub
The app has been deployed to GitHub and a link to the page can be found here: Python-Battleships - GitHub
Heroku
The app has been deployed to Heroku and a link to the page can be found here: Python-Battleships - Heroku
note - no secret key is needed