Giter VIP home page Giter VIP logo

battleship-5's Introduction

Battleshipasaurus

Battleshipasaurus is a Battleship game created using Python, and runs on a mock terminal on Heroku.

๐Ÿ‘‰ Live Project

Instructions

The aim of the game is to sink the enemies battleships:

  • If they correctly guess all the ships on the board they win

  • If they don't hit all the ships within the number of turn they lose the game

Technologies

Python - main game language and it's default modules VS Code - To set up Python environment and text editor [Heroku] for site deployment and to store created files

Features

  • One player game

  • Instructions of the game

  • User feedback for errors

  • Grid elements so that user can distinguish between empty spaces, ships and misses

  • Game Over prompt, Restart Game prompt to allow user to control start of game within the console.

  • Number of turns are displayed to the user

  • Number of ships left are displayed to the user

Future Features

  • User to play against the computer

  • Custom grid size

  • Increased game difficulty

  • Option to add different types of ships like the Carrier, Cruiser, Submarine etc.

Data Model

Game is made using python functions

Testing

Bugs

Solved bugs

  • Fix bug where value entered in terminal did not match the board index.

  • Fix bug where console with give valueError when game is run for the first time

  • Fix bug where game over prompt was not being triggered at the end of game loop

Unfixed bugs

  • Game start prompt will not start the game loop if too many gaps are typed in the console.

Validator testing

  • PEP8

Deployment

Game was deployed using Heroku

  • In your vscode or gitpod terminal inside your current workspace: type in:
    • touch requirements.txt
    • pip3 freeze > requirements.txt

This is to add dependencies to your deployed project

  • To deploy this project you need a Heroku account

  • Once logged in, click the CREATE NEW APP button

  • Add a unique name for your project in lowercase and spaces separated by '-' the create new app

  • Click on the settings page and add the Python THEN the Node.js build packs

  • Go to the Deploy tab

  • Connect your GitHub account and select the 'main' brach of your project

  • Near the bottom on the page, you have two options on how to deploy your project. You can either do:

    • Automatic Deployment which will deploy your project after every change to your main github repository
    • Manual Deployment where the user has to prompt for the deployment.
  • Which ever option you decide you have to do an initial Manual deployment to Heroku for the first upload.

  • The app will install the necessary files and dependencies. Finally, a message was displayed: 'Your app was successfully deployed.'

Acknowledgements

battleship-5's People

Contributors

datonex avatar

Watchers

 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.