Giter VIP home page Giter VIP logo

python-battleships's Introduction

Logo

Welcome to Battleships!

Intro

This is a simple guessing game where the computer generates a board with 5 ships and the player must sink them in 10 turns.


How To Play

  1. An empty board will be displayed and the player must input a row guess between 1 and 8.

  2. The player will then input a column guess between A and H.

  3. The empty board will display and show if its a HIT or MISS. HIT = X MISS = -

  4. Repeat until either all ships are sunk or turns run out.


User Experience

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

  1. 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.

  2. 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.

  3. 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.


Features

Start of Game

Displays Board and Input Fields

Welcome

If Missed A Shot

Displays MISS and returns how many turns are left to guess

Missed Shot

Guessed Already

Displays Error if user guessed in that space already

Guessed Already

Game Over

Displays Game Over showing the board that the computer generated

Game Over

Testing

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.

Pep8

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.

Pep8 Testing

ExtendsClass

ExtendsClass showed no errors.

ExtendsClass Testing

Future Development

  1. Add ability for user to create board and place ships and computer to guess.

  2. Increase size of battleships so vary in sizes and allow for computer to use tactics to sink player ships.

Deployment

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

Final Preview of app

python-battleships's People

Contributors

mattm1346 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.