Giter Club home page Giter Club logo

ship_battle's Introduction

Ship Battle

By Patrick Alexander Lucas Van Der Flier

Responsive image from the project

Ship Battle :

Ship Battle was developed as my first python project by me as my third Full Stack Web Development project with Code Institute.

Reason :

Since Python is a very interesting language easy to use, and unbelievably annoying when it comes to indentations and semi-columns, I've thought a battleship game would be a perfect choice. As a child, I always loved video games so I felt affinity regarding this project, just an amazing experience

Battleships

Is a strategy-type guessing game for two players. It is played on ruled grids (paper or board) on which each player's fleet of warships is marked. The locations of the fleets are concealed from the other player. Players alternate turns calling "shots" at the other player's ships, and the objective of the game is to destroy the opposing player's fleet.

How to play :

Ship Battle is based on the original version of the battleship game. In this terminal version, the user can place 5 different ships vertically and horizontally with a size of 2, 3, 4, 5 while the computer generates a random position on his board, the objective is to hit all 5 enemy ships

Features :

The Features were designed to be as simple as possible since is a terminal game you don't need much to play

  • User name :

    • lets the player freely choose a username of his choice. Photo from a user name in game
  • Main menu :

    • allow the user to choose between 3 menu options to start the game, read instructions and see credits. Photo from the main menu
  • instructions :

    • explains to the player how to play the battleships game.
    • Allows the player to start the game or return to the main menu. Photo from instructions
  • Ships placement :

    • Allows the user to place 5 ships of different sizes vertically and horizontally.
    • Checks the overlap of the ships, so you cant place a ship on the map.
    • Computer randomly places enemy ships. Ships placement photo
  • Hit/Miss check :

    • Checks if your attack successfully hits a ship or the water landing page image
  • Calling shots :

    • The player may choose a vertical or horizontal orientation and a number from 1 - 8 to call his shot.
    • Computer does the same by itself.

Testing :

  • Passed the code through PEP8 and only got line size issues nothing that compromises the game or the code flow.
  • Used a lot of print statements to test every main function of the game.
  • Type error value error and key error were used to check if the expected input was the right input.

Test Validators :

  • Passed through PEP8 validation without any issues Image of PEP8 validation

Deployment :

  • This project was deployed to Heroku follow the steps below to deploy.
    1. Create a Heroku account
    1. Click on create a new app
    1. Give the app a name of your choosing
    1. Pick your region.
    1. configure the settings the way it fits your project
    1. pick a deployment method.
    1. look for your repository name
    1. Click search and click connect
    1. pick between manual or automatic deployment
    1. Click on the link to see your project link

Credits :

Observations :

I have a bad practice that is good to mention, to avoid unnecessary commits I like to code every major part in the Visual studio code so I don't need to commit a lot of things, I thought this was a very good idea at first, but this pushes a lot of inconsistency in my commits.

Special thanks

I would like to thank everyone who helped me with this project.

  • My mentor.
  • My good friend Armandinho.
  • Jean my good French friend for all the support and advice.
  • Code Institute for giving the best support to develop this project.

ship_battle's People

Contributors

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