Giter VIP home page Giter VIP logo

diegoh22-battleships_julyresub's Introduction

Battleship is a terminal game programed with Python, which runs in the Code Institute mock terminal on Heroku.

Battleship is a funny and a widely-known board game in which the goal is to destroy the opposing player's fleet. It all depends on the luck of your finding shots to initially hit your targets.

Single Battleships

Capture

The computer place 5 ships randomly in both board and you will have to sunk the 5 ships before the 10 tunrs are over!

ENjoy.

https://single-battleships.herokuapp.com/

How to play

In this version of Battleship the user starts the game by first typing the size of the grid they would like to play on. By typing in the name of the player, the game will then fire on and the user will have the ability to strike their first move by guessing and calling out coordinates to find out the computer ships and sink them. The game will randomly generate and populate 5 ships on each board. The grid always start on: 0 row and 0 columns. Guesses are marked on the board with an X and hits are marked by * . To gain a win, you have to sink all the computer's ships before your run out of tunrs or the computer sunk all your ships

Features

startgame

Exiting Features

Boards guesees endgame

Randon

Board Generation

Ships are place randomly by the computer

Scoring system and Turns sytem.

Input validation and errors-cheking

you must enter A colunm and a row both with number from 0 to 9

you cannot enter the same guess twice

nothing outside the grid of 9

Furture Features

count down timer

Ships larger than 1x1

music in the Game

Data Model

I decided to use two classes for the game model. One Board class and one Game class.

Board Class

self.size = To set the board size

self.num_ships = To set number of ships in-game

self.player = Bolian indicate if the board belongs to a player or computer

self.guesses = List of passed guesses

self.populate = Creates in-memory board with the players ship

Game Class

self.size = To set the board size

self.num_ships = To set number of ships in-game

self.scores = Set score when ship is sunk

Testing

Passed the code through a PEP* linter and confirmed there no problems

Tested in my local terminal and the code isntitute Heroki terminal

Bugs

Still a bug went you run the debugging the system stops on the name input part, i could find the way to fix that bug.

Remaining Bugs

No remainding bugs in this code

Valitor Testing

PeP8

No errors

Pip8

Languages, Frameworks, IDE, Libraries and Programs

Python:

The programming language Python was used.

Python random library:

random.randint was used to generate random integer numbers in the game.

GitHub:

GitHub was used to store the projects code after being pushed from Git.

Gitpod:

Was used to complement the development and write my project and push all commits through integrated "git" to Github.

Heroku:

Was used for deployment of the project live in the cloud.

Deployment

This project was published and deplyed using the Code Institute mock teminal for Heroku

Steps for deployment:

Fork or clone this repository

Create a new Heroku application

Set the buildpack in the setting to "heroku/python" and "heroku/nodejs"

In the "Deploy" menu chose "Deployment method" GitHub

Connect and choose the repository in the "App connected to GitHub"

Choose either "Automatic deployment" = which means that every push to the branch you specify will deploy a new version of this app

"Manual deploy" = this will deploy the current state/version of the branch

The live link can be found here -https://single-battleships.herokuapp.com/

Credits

Code Institute idea from Project Portfolio 3

Code Institute project 3 Scope video

To all code institute Studen support

diegoh22-battleships_julyresub's People

Contributors

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